• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Cluster and Host Management (Proprietary APIs)
  5. Constructing Requests

Constructing Requests

A request consists of three parts: a request line, a request header, and a request body (optional).

Request Line

A request line starts with a method token, which is followed by a request uniform resource identifier (URI) and protocol version. The three parts are separated by spaces. The format of the request line is as follows:

Method Request-URI HTTP-Version CRLF
  • Method: request method. All methods are capitalized. Their meanings are as follows:
    • GET: obtains resources identified by a Request-URI.
    • POST: adds new data to a resource identified by a Request-URI.
    • PUT: requests a server to save a resource and uses a Request-URI to identify the resource.
    • DELETE: requests the server to delete the resource identified by a Request-URI.
    • PATCH: requests a server to update a resource or create a new resource if the target resource does not exist.
    • HEAD: requests only the page header.
    • OPTION: allows the client to view server performance.
  • Request-URI: unified resource identifier.
    NOTE:

    Request-URI is in the format [path][?query], where:

    • If there are multiple paths, separate them by a forward slash (/).
    • If there are multiple queries, separate them by ampersand (&).
    • path and query are separated by a question mark (?).
  • HTTP-Version: version of the HTTP protocol used by a request.
  • CRLF: carriage return and new-line characters. CRLF is placed only at the end of a line, and a separate CR or LF is not allowed.

Request Header

A request header consists of several header fields. Each header field is in the format: field name:field value.

Table 1 shows the common request headers. Except Cotent-Type, other header fields are CCE-specific.

Table 1 Common request headers fields

Parameter

Description

Mandatory

Example Value

Content-Type

Nature of the data in the body of an entity.

Yes

application/json

X-Auth-Token

Token authentication information acquired during Token Authentication.

NOTE:

This header field is mandatory if Token authentication is in use.

No

-

X-Sdk-Date

Time at which the request was sent.

NOTE:

This header field is mandatory if AK/SK authentication is in use.

No

20151222T034042Z

Authorization

Authentication information, which can be obtained from the request signing result.

NOTE:

This header field is mandatory if AK/SK authentication is in use.

No

SDK-HMAC-SHA256 Credential=ZIRRKMTWPTQFQI1WKNKB/20151222/eu-de/ec2/sdk_request, SignedHeaders=connection;content-type;host;x-sdk-date, Signature=7972cc9145876d174b3862188a0f61819431fa71c8a8a060809ea8b898

e3eaa9

Host:www.myhwclouds.c

om

Request Body

A request body is a JSON-style nested key:value pair. The mandatory fields and optional fields in an HTTP request vary depending on the URI object.