Message Formats

Overview

In some methods, a format for both the request and the response can be specified using either the Content-Type header, the Accept header or adding an extension (like .json or .xml) to the request URL.

Format Detection

Detection of the Request and Response format is done according to the following priorities table:

Priority

Format description

1 (highest)

URL extension (like .xml or .json)

2

Content-Type Header

3 (lowest)

Accept Header

If a specified header conflicts with the specified format extension, the latter takes precedence.

Supported Formats

Format

Accept Header

Extension

Default

JSON

application/json

.json

Yes

XML

*/*

.xml

APS

application/aps

.aps

JSON is currently the default format for both requests and responses.

This example shows how a user or an application can get an .app.zip package archive.

# curl -H 'Accept: application/aps' -E ./config/9e8dc5ed-8e02-4d76-9c5e-4d3aa63259a7.pem \
-k https://b.isv1.apsdemo.org:6308/aps/2/packages/efba84ac-66cb-44f1-83c2-18aaff14c009 \
> myapp.app.zip

The header Accept:application/aps ensures you get the package archive. With any other value in this header, you get only general application metadata in JSON format.