diff mbox

docs/api: change POST to PATCH in REST API parameters example

Message ID 20170525080510.2345-1-andrew.donnellan@au1.ibm.com
State Accepted
Headers show

Commit Message

Andrew Donnellan May 25, 2017, 8:05 a.m. UTC
api/rest.rst gives an example of how to POST parameters to the PatchDetail
view at api/patches/<patch_id>. However, the endpoint in question doesn't
support POST - you need to use PUT or PATCH. Change it to PATCH.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

I have no idea whether it's *meant* to support POST...
---
 docs/api/rest.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Finucane May 26, 2017, 8:39 a.m. UTC | #1
On Thu, 2017-05-25 at 18:05 +1000, Andrew Donnellan wrote:
> api/rest.rst gives an example of how to POST parameters to the
> PatchDetail
> view at api/patches/<patch_id>. However, the endpoint in question
> doesn't
> support POST - you need to use PUT or PATCH. Change it to PATCH.
> 
> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

Yup - my bad.

Acked-by: Stephen Finucane <stephen@that.guru>

and applied.

> ---
> 
> I have no idea whether it's *meant* to support POST...

We do not - we want/need Patchwork to do the parsing itself, rather
than allow arbitrary creation of "patches". It might make sense to
allow uploading raw mbox files (superuser only) in the future if people
request it, but this would be a different endpoint (/upload?).

> ---
>  docs/api/rest.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/api/rest.rst b/docs/api/rest.rst
> index 1750913..8c8fd95 100644
> --- a/docs/api/rest.rst
> +++ b/docs/api/rest.rst
> @@ -155,7 +155,7 @@ parameters should be passed as form-encoded data:
>  
>  .. code-block:: shell
>  
> -    $ curl -X POST -F 'state=under-review' \
> +    $ curl -X PATCH -F 'state=under-review' \
>        'https://patchwork.example.com/api/patches/123'
>  
>  Authentication
diff mbox

Patch

diff --git a/docs/api/rest.rst b/docs/api/rest.rst
index 1750913..8c8fd95 100644
--- a/docs/api/rest.rst
+++ b/docs/api/rest.rst
@@ -155,7 +155,7 @@  parameters should be passed as form-encoded data:
 
 .. code-block:: shell
 
-    $ curl -X POST -F 'state=under-review' \
+    $ curl -X PATCH -F 'state=under-review' \
       'https://patchwork.example.com/api/patches/123'
 
 Authentication