From 018427e2b63648a8e1674f85403fe848d1d137d6 Mon Sep 17 00:00:00 2001 From: David Baynard Date: Fri, 9 Jun 2023 21:23:04 +0100 Subject: [PATCH] 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`. --- docs/references/api/resource_representation.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/references/api/resource_representation.rst b/docs/references/api/resource_representation.rst index 82f27d96b..c11d8e872 100644 --- a/docs/references/api/resource_representation.rst +++ b/docs/references/api/resource_representation.rst @@ -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