From 6e7a2ca26ceef686a0897b0f7ec0315833846723 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Fri, 25 May 2018 12:02:23 -0500 Subject: [PATCH] Fix #135, clarify usage of GET/POST RPC --- api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.rst b/api.rst index 752b7c7de..979874e56 100644 --- a/api.rst +++ b/api.rst @@ -529,7 +529,7 @@ Because ``add_them`` is declared IMMUTABLE, we can alternately call the function GET /rpc/add_them?a=1&b=2 HTTP/1.1 -For POST and GET the keys of the object match the parameter names. Note that PostgreSQL converts parameter names to lowercase unless you quote them like :sql:`CREATE FUNCTION foo("mixedCase" text) ...`. You can also call a function that takes a single parameter of type json by sending the header :code:`Prefer: params=single-object` with your request. That way the JSON request body will be used as the single argument. +The function parameter names match the JSON object keys in the POST case, for the GET case they match the query parameters ``?a=1&b=2``. Note that PostgreSQL converts parameter names to lowercase unless you quote them like :sql:`CREATE FUNCTION foo("mixedCase" text) ...`. You can also call a function that takes a single parameter of type json by sending the header :code:`Prefer: params=single-object` with your request. That way the JSON request body will be used as the single argument. .. note::