comparison doc/rest.txt @ 7685:0e3d31a6b7fd

doc: clarify use of .xml or .json extensions in REST interface Document that /rest and /rest/data do not support extensions.
author John Rouillard <rouilj@ieee.org>
date Thu, 26 Oct 2023 11:28:54 -0400
parents 3eca3462ba0c
children 4c85e3e16dfe
comparison
equal deleted inserted replaced
7684:3eca3462ba0c 7685:0e3d31a6b7fd
334 way to specify alternate acceptable response formats. 334 way to specify alternate acceptable response formats.
335 335
336 To make testing from the browser easier, you can also append the 336 To make testing from the browser easier, you can also append the
337 extension ``.json`` or ``.xml`` to the path component of the url. This 337 extension ``.json`` or ``.xml`` to the path component of the url. This
338 will force json or xml (if supported) output. If you use an extension 338 will force json or xml (if supported) output. If you use an extension
339 it takes priority over any accept headers. 339 it takes priority over any accept headers. Note the extension does not
340 work for the ``/rest`` or ``/rest/data`` paths. In these cases it
341 returs a 404 error. Adding the header ``Accept: application/xml``
342 allows these paths to return xml data.
340 343
341 The rest interface returns status 406 if you use an unrecognized 344 The rest interface returns status 406 if you use an unrecognized
342 extension. You will also get a 406 status if none of the entries in 345 extension. You will also get a 406 status if none of the entries in
343 the accept header are available or if the accept header is invalid. 346 the accept header are available or if the accept header is invalid.
344 347
345 Note: ``dicttoxml2.py`` is an updated version of ``dicttoxml.py``. If 348 Note: ``dicttoxml2.py`` is an updated version of ``dicttoxml.py``. If
346 you are still using Python 2.7 or 3.6, you should use 349 you are still using Python 2.7 or 3.6, you can use ``dicttoxml.py``.
347 ``dicttoxml.py``.
348 350
349 351
350 General Guidelines 352 General Guidelines
351 ------------------ 353 ------------------
352 354

Roundup Issue Tracker: http://roundup-tracker.org/