The
vCloud Air
Platform APIs support XML and JSON data input and output formats. Whether you
specify JSON or XML in a request, the data structure returned in the response
is equivalent for both formats; the only difference is the data encoding
differs by format.

Request
Headers

In HTTP requests, API clients
must specify in the
Content-Type header the format in which data is
submitted:

Content-Type: application/xml
Content-Type: application/json

For HTTP responses, specifying
the media type and subtype is optional.

For HTTP responses, the
vCloud Air
Platform APIs support specifying in the
Accept header the following media types and subtypes:

When you do not specify a
media type or subtype or you specify wildcards in an
Accept header, the
vCloud Air
Platform APIs provide the HTTP response by using
application/xml. To receive a response using JSON, you
must explicitly specify
application/json in the
Accept header.

Media Type and Subtype
Support

Type

Media Range

Application media type and JSON subtype

Accept:application/json;class=mediatype

Application media type and XML subtype

Accept:application/xml;class=mediatype

Wildcard media type and subtype

■

Accept:application/*;class=mediatype

■

Accept:
*/*;class=mediatype

■

Media type
defaults to “application”

■

Subtype
defaults “xml”

Note

Specifying the
media class for a resource is optional and does not include versioning
information.