alt Clause: Selecting the Return Type

Description

Specifies the response format.

Applies To

All resources.

Remarks

The preferred method of specifying the response format is to use an Accept HTTP header. The Accept header enables specifying multiple alternative media types.

The use of alt instead of an Accept header enables passing a single URL for a specific media type to other applications. Using the Accept header, the application must pass a URL and a value for a specific header.

The alt query parameter specifies the media type of the response. The value can be any media type supported the resource being accessed, including the default media type for the resource.

The alt query parameter applies to the GET and HEAD methods. If supplied with other methods, it is ignored.

If the alt value is not recognized or supported, the service responds with HTTP status code 406, Unsupported ACCEPT type.

Examples

alt=application/xml

alt=application/json

alt=application/octet-stream