From d88ba988e34205ebc0d5217511a6f5ba144cb674 Mon Sep 17 00:00:00 2001 From: sunetfreitag <71124321+sunetfreitag@users.noreply.github.com> Date: Mon, 10 Nov 2025 15:10:52 +0000 Subject: [PATCH] Add Accept header to curl example in ocs-api-overview.rst The return type of ocs calls can easily be changed by adding an Accept header to the request. Since some ocs calls return xml as their default, while others return json, it might be beneficial to the reader to state this early in the documentation. Signed-off-by: sunetfreitag <71124321+sunetfreitag@users.noreply.github.com> --- developer_manual/client_apis/OCS/ocs-api-overview.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/developer_manual/client_apis/OCS/ocs-api-overview.rst b/developer_manual/client_apis/OCS/ocs-api-overview.rst index 7a6e7b09984..9f68dc1b5a8 100644 --- a/developer_manual/client_apis/OCS/ocs-api-overview.rst +++ b/developer_manual/client_apis/OCS/ocs-api-overview.rst @@ -37,6 +37,13 @@ For example: you can perform a :code:`GET` request to get information about a us curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true" +You can change the response type of your request by adding an Accept header. For example, if you prefer JSON respones: + +.. code-block:: bash + + curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "Accept: application/json" -H "OCS-APIRequest: true" + +Adding the Accept header also ensures consistency of your responses, since some legacy OCS requests return XML as their default response, while newer requests return JSON. User metadata -------------