For certain resources, my RESTful server only accepts PUT
and POST
requests with JSON objects as the content body, thus requiring a Content-Type
of application/json
instead of application/x-www-form-urlencoded
or multipart/form-data
or anything else.
Malformed JSON (or lack thereof) returns a 400
with the error message taken directly from the exception raised by the JSON parser, for debugging purposes.
Which HTTP error code means that the client sent a request with an unacceptable Content-Type
, even if the server could technically parse the request content?
Status codes 309 through 399 are currently unassigned.
HTTP response codes 200 – 299 are bearers of good news: the request has been accepted, a new request has been created, or a certain problem was solved.
The HTTP 204 No Content success status response code indicates that a request has succeeded, but that the client doesn't need to navigate away from its current page. This might be used, for example, when implementing "save and continue editing" functionality for a wiki site.
The HyperText Transfer Protocol (HTTP) 401 Unauthorized response status code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource.
It could be 415 Unsupported Media Type
according to this list: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With