Updated on 2024-03-05 GMT+08:00

Request Message

A request message consists of the request line, request header, and request body (optional). Table 1 describes the request message format.

Table 1 Request message format

HTTP/HTTPS Request Message

HTTP/HTTPS request line

Method Request-URI HTTP-Version

NOTE:

There is a space between Method and Request-URI, and between Request-URI and HTTP-Version. There is a carriage return behind HTTP-Version.

Request header

Content-Type:application/json;charset=UTF-8

Blank line

CRLF

Message body (optional)

Business request message (JSON description)

Request Line

A request line starts with a method token, followed by the request URI and the protocol version. There is a space between Method and Request-URI, and between Request-URI and HTTP-Version. The request line format is as follows:

Method Request-URI HTTP-Version CRLF

  • Method: request method, for example, GET, POST, PUT, and DELETE.
  • Request-URI: uniform resource identifier. For example, the universal URI format is https://10.10.10.2:9443/balancemgmt/v1/balance.
  • HTTP-Version: HTTP protocol version of the request, for example, HTTP/1.1.
  • CRLF: carriage return and line feed character. CRLF is placed only at the end of a line. CR and LF must be present at the same time.

Request Header

A request header consists of multiple header fields. Each header field consists of a field name and value, which are separated by a colon (:). A request header at the virtualization layer generally includes the following header fields:

  • Host: https://<hostname>[:<port>]

    The default port number for HTTPS is 9443.

  • Content-Type: application/json

    Indicates that the message body type is JSON.

  • Accept: application/json;version=1.0
  • Accept-Language:zh_CN

    Specifies the language of the response. The options are zh_CN (simplified Chinese) and en_US (English).

  • Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

    Authentication field, which uses a user ID and password for authentication.

  • AccessKeyId: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Access ID of an account or a user, which identifies the owner who creates the resource. This field is mandatory when the C3 business interface is invoked and optional when the C3 maintenance interface is invoked.

Request Body

The request body is in JSON format. For details, see the definition of each API in the following sections.