Note content-type for singular objects (#639)

* Clarify vnd.pgrst.object+json is also Content-Type

The previous docs explained how the `Accept` header could be set to
`application/vnd.pgrst.object+json`. This change indicates the resulting
response `Content-Type` begins likewise.

While robust clients will correctly identify that
`application/vnd.pgrst.object+json` data are json, many others which
naively check the `Content-Type` is `application/json` will fail to
recognize what should be a valid `Content-Type`.
This commit is contained in:
David Baynard
2023-06-09 15:23:04 -05:00
committed by GitHub
parent ee6b9c5224
commit 018427e2b6
@@ -66,6 +66,8 @@ This returns
{ "id": 1 }
with a :code:`Content-Type: application/vnd.pgrst.object+json`.
When a singular response is requested but no entries are found, the server responds with an error message and 406 Not Acceptable status code rather than the usual empty array and 200 status:
.. code-block:: json