I am using the WorldCat Search API, why do I keep getting an XML response when I am sending a json accept header?
Applies to
- WorldCat Search API
- WorldCat Discovery
Issue
The documentation indicates that I should be able to get a response in JSON, and links to an example of such a response, but even though I'm sending an Accept header with the value 'application/json', I keep getting the XML response.
Answer
Search API doesn't support "Content-Negotiation". You need to add the format parameter and set it to JSON.
example:
http //www worldcat.org/webservices/catalog/content/libraries/isbn/{ISBN}?oclcsymbol={OCLC_Symbol}&format=json