[wp-trac] [WordPress Trac] #39150: Empty JSON Payload Causes rest_invalid_json

WordPress Trac noreply at wordpress.org
Fri Dec 9 18:59:31 UTC 2016


#39150: Empty JSON Payload Causes rest_invalid_json
--------------------------------------+-----------------------
 Reporter:  GamerZ                    |       Owner:  jnylen0
     Type:  defect (bug)              |      Status:  accepted
 Priority:  normal                    |   Milestone:  4.7.1
Component:  REST API                  |     Version:  4.7
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------

Comment (by boonebgorges):

 I just ran into this as well, in my case with a GET request.

 I defer to the API team on this, but I wonder if a narrower fix might be
 to skip body parsing (or allow empty body) for methods that don't
 specifically support a message-body. This seems like it would jibe better
 with RFC 2616, which says that servers should ignore the body for these
 request types. https://tools.ietf.org/html/rfc2616#section-4.3

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39150#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list