Skip to content

Issue an invoice, PATCH method #633

Description

@jeromecc

Hello!

I am using django-silver version 0.7.0 installed through pip with Django 1.11, Python 2.7, djangorestframework version: 3.8.2

I am testing invoice creation through the API. I can create invoices without any problem (when adding appropriate currency related fields ;-) using httpie.

When I try to issue an invoice using the PATCH method indicated in the documentation, I get a 450 Method Not Allowed error:

(testcopper) user@debian:$ http --auth login:password PATCH http://127.0.0.1:8008/silver/invoices/5/state/ @issue1.json
HTTP/1.0 405 Method Not Allowed
Allow: PUT, OPTIONS
Content-Length: 42
Content-Type: application/json
Date: Fri, 01 Feb 2019 07:25:15 GMT
Server: WSGIServer/0.1 Python/2.7.15+
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
"detail": "Method "PATCH" not allowed."
}

When I use the PUT method, it works:

(testcopper) user@debian:~/dev/python/django/test-copper$ http --auth login:password PUT http://127.0.0.1:8008/silver/invoices/5/state/ @issue1.json
HTTP/1.0 200 OK
Allow: PUT, OPTIONS
Content-Length: 1837
Content-Type: application/json
Date: Fri, 01 Feb 2019 07:52:38 GMT
Server: WSGIServer/0.1 Python/2.7.15+
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
...
"id": 5,
...
"state": "issued",
...
}

I am relatively new to Django & I don't know much about DRF. Is it a documentation problem? Am I missing something?

Thanks.
jérôme

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions