Skip to content

Commit 0522bce

Browse files
authored
Merge pull request #13850 from sunetfreitag/patch-1
2 parents 18cb3eb + b8024b1 commit 0522bce

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

developer_manual/client_apis/OCS/ocs-api-overview.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ For example: you can perform a :code:`GET` request to get information about a us
3737
3838
curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true"
3939
40+
You can change the response type of your request by adding an Accept header. For example, if you prefer JSON responses:
41+
42+
.. code-block:: bash
43+
44+
curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "Accept: application/json" -H "OCS-APIRequest: true"
45+
46+
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.
4047

4148
User metadata
4249
-------------

0 commit comments

Comments
 (0)