Request format

You use the HTTP POST method to send a metadata query API request to HCP. The POST request for both object-based and operation-based queries has these elements:

A request URL.

For information on request URL formats, see Request URL.

Optionally, if the URL starts with an IP address, an HTTP Host header.

For information on specifying the HTTP Host header, see Connecting using an IP address.

An Authorization header.

For information on the Authorization header, see Authentication.

An HTTP Content-Type header with one of these values:

oIf the request body is XML, application/xml

oIf the request body is JSON, application/json

An HTTP Accept header to specify the response format: application/xml or application/json.

Optionally, to send the query in gzip-compressed format:

oAn HTTP Content-Encoding header with a value of gzip

oA chunked transfer encoding

Note: When using cURL to send the query in gzip-compressed format, the request must specify --data-binary. If the request specifies -d instead, HCP returns a 400 (Bad Request) error.

Optionally, to request that HCP return the response in gzip-compressed format, an HTTP Accept-Encoding header containing the value gzip or *. The header can specify additional compression algorithms, but HCP uses only gzip.

Optionally, to request that HCP format the returned XML or JSON in an easily readable format, a prettyprint URL query parameter. The prettyprint parameter increases the time it takes to process a request. Therefore, you should use it only for testing purposes and not in production applications.

A request body containing the query criteria and specifications for the contents of the result body. The entries you can specify depends on whether the request body is for an object-based query or an operation-based query.

A request returns a 413 response code if the request exceeds the 8K Content-Length body limit.

For more information on the request body for object-based queries, see Object-based query requests. For more information on the request body for operation-based queries, see Operation-based query requests.

Trademarks and Legal Disclaimer

© 2016 Hitachi Data Systems Corporation. All rights reserved.