When a consumer is creating requests, there are two mechanisms it can use to specify a preference for which data serialization format to use:
- the alt query parameter on a request URL, or
- an Accept: header of the http request.
For example, if a consumer wishes to process responses using JSON, then it could issue the following request:
GET /instances?alt=json
If the EDAA receiving the above request supports the JSON serialization format, it would return a collection of instance representations in JSON. EDAA conventions on JSON describes how collections of resource instances are represented in JSON in EDAA.
If the EDAA doesn't support JSON, it will return an error, http code 400 (bad request).
An equivalent request can be made using an http header:
GET /instances Accept: application/json