• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (Swift)
  4. Methods of Calling APIs
  5. Request Methods

Request Methods

A request sent to OBS (compatible with OpenStack Swift) must comply with HTTP 1.1. In addition, the headers of a request must contain parameters defined in IAM, for example, authentication fields.

HTTP supports several HTTP request methods, such as GET, PUT, POST, DELETE, HEAD, and COPY. A request method indicates how to access specific resources. Table 1 describes the request methods supported by REST APIs that are provided by OBS (compatible with OpenStack Swift).

Table 1 REST request methods supported by OBS (compatible with OpenStack Swift)

Method

Description

GET

Requests the server to return a specific resource, for example, obtaining a container or object list or downloading an object.

PUT

Requests the server to store a specific resource, for example, creating a container or uploading an object.

POST

Requests the server to modify a specific resource such as container or object metadata.

DELETE

Requests the server to delete a specific resource such as an object.

HEAD

Requests the server to return the digest of a specific resource, for example, obtaining object metadata.

COPY

Requests the server to copy a specific resource such as an object.

Request Headers

When sending a REST request to OBS (compatible with OpenStack Swift), you need to add parameters in request headers. For details about request headers, see the descriptions of the specific operations.

HTTP Request Rules

  • The number of HTTP headers cannot exceed 90. If the token header is included, the number of HTTP headers cannot exceed 91.
  • The total size of all HTTP headers cannot exceed 4096 bytes.
  • The length per HTTP request line cannot exceed 8192 bytes.
  • The data in an HTTP request cannot exceed 5 GB.
    NOTE:

    When sending a REST request to OBS (compatible with OpenStack Swift), you must comply with the preceding HTTP request rules. If any upper limit is exceeded, the error response may be different from that defined by OpenStack Swift. The request rules for the original OpenStack Swift APIs do not strictly check requests based on the preceding rules, but require users to comply with the preceding standard HTTP request rules.

    When the parameter length (request headers and content) of a request exceeds the buffer size of the server, OBS (compatible with OpenStack Swift) returns a 413 Request Entity Too Large: head, whereas OpenStack Swift returns a 400 Bad Request.