Requesting a Specific Format

Top  Previous  Next

All Web3 resources support multiple representation formats. The Web3 services support two ways of requesting a result in a specific format:

 

Use a Content-Type header.
This is the preferred method. Set the Content-Type header in the request to the MIME type of the requested format.
Use a format= query parameter
This can be useful for viewing responses in a web browser as the format requested in this way will always override the MIME type requested in the Content-Type header.

 

The table below lists the supported formats, the recognized MIME types and the recognized format query parameter values.

 

Format

MIME Type(s)

format Query Parameter Value

XML

application/xml

xml

JSON

application/json
text/json
application/javascript
text/javascript

json

HTML

text/html

application/xhtml+xml

html

RDF

application/rdf+xml

rdf

XTM 2.0

application/x-tm+xml;version=2.0

application/x-tm+xml

text/xtm20

xtm