Content Negotiation

When issuing a query request to a web service, there are two methods for requesting a specific resource type:

  • URI Extensions
  • Content Negotiation

URI Extensions

Examples:

http://worldcat.org/institution/1.json
http://worldcat.org/institution/1.xml
http://worldcat.org/institution/1.html

HTTP Accept header

Examples:

Accept: "application/json"
Accept: "application/xml"
Accept: "application/atom+xml"

Web Services perform Content Negotiation in the following order:

  1. Use the URI extension (if provided)
  2. Use the HTTP Accept header