Bugzilla:BzAPI: Difference between revisions

Jump to navigation Jump to search
Line 44: Line 44:
== Data Formats ==
== Data Formats ==


On every request, you must set both Accept: and Content-Type: headers to the MIME type of the data format you are using to communicate with the API. Content-Type tells the API how to interpret your request, and Accept tells it how you want your data back. The two do not have to be the same.
'''On every request, you must set both the "Accept" and "Content-Type" HTTP headers to the MIME type of the data format you are using to communicate with the API.''' Content-Type tells the API how to interpret your request, and Accept tells it how you want your data back.


Currently, the API has only been tested with JSON. Although it's currently the default, if you are using JSON you should still set an "Accept: application/json" header on all calls. However, [http://search.cpan.org/~bobtfish/Catalyst-Action-REST-0.77/lib/Catalyst/Controller/REST.pm Catalyst::Controller::REST] supports a number of serialization and deserialization formats, and can be extended for more. XML is next on the list to test with, but set "Accept: text/xml" and see what you get back :-) And then try feeding it back in again... But the XML output format is very much ''not'' frozen.
Currently, the API has only been tested with JSON (MIME type: "application/json"). However, [http://search.cpan.org/~bobtfish/Catalyst-Action-REST-0.77/lib/Catalyst/Controller/REST.pm Catalyst::Controller::REST] supports a number of serialization and deserialization formats, and can be extended for more. Feel free to set "Accept: application/xml" and see what you get back, and then try feeding it back in again. But be aware that the XML output format, and any other non-JSON formats for that matter, are very much ''not'' frozen.


== Errors ==
== Errors ==
Account confirmers, Anti-spam team, Confirmed users, Bureaucrats and Sysops emeriti
4,925

edits

Navigation menu