OBS (compatible with OpenStack Swift) returns an HTTP response after receiving and processing a request.
Status Line: HTTP-Version Status-Code Reason-Phrase Response Headers <Conditional Response Body>
The first line of a response is the Status-Line, consisting of the protocol version, numeric status code, and textual phrases. The previous elements are separated by spaces. See Table 1.
Element |
Description |
---|---|
HTTP-Version |
HTTP version. OBS (compatible with OpenStack Swift) uses HTTP 1.1. |
Status-Code |
Status code, which describes the response type. |
Reason-Phrase |
Reason phrase, which describes the status code in a short text. |
The first digit of the status code defines the response type. The last two digits do not have this function. There are five types of status codes, categorized based on the first digit. The categories are described in Table 2.
Status Code |
Description |
---|---|
1xx |
The server has received but is still processing the request. |
2xx |
The request has been received, understood, and accepted. |
3xx |
The client must take further actions to complete the request. |
4xx |
There was an error on the client side. The request contains bad syntax or cannot be fulfilled. |
5xx |
There was an error on the server side. The server failed to fulfill a valid request. |
Status Code |
Description |
Returned After |
---|---|---|
100 Continue |
The initial part of the request has been received and has not yet been rejected by the server and the client should continue with its request. |
|
Status Code |
Description |
Returned After |
---|---|---|
200 OK |
The server has received and accepted the client's request. |
|
201 Created |
The response may contain an XML file. The XML file describes the response content. |
|
202 Accepted |
The server has received the request. |
|
204 No Content |
The server has processed a request successfully, but no content was returned. |
|
Status Code |
Description |
Returned After |
---|---|---|
303 See Other |
The client can use another URL to get a specific object. |
POST operations (provided that redirection parameters in requests are valid.) |
304 Not Modified |
After the client sent a GET request with the required modification time, access was allowed but the resource was not modified after the specified time. |
The resource is obtained but the modification time condition is not met. |
307 Moved Temporarily |
A request has been redirected. |
A request is redirected after it fails to be processed by the server. |
Status Code |
Description |
Returned After |
---|---|---|
400 Bad Request |
The syntax of a request was incorrect. |
A request in incorrect syntax or containing incorrect parameters is sent. |
401 Unauthorized |
The request could not be authenticated. |
The user does not exist or the authentication information in a sent request is incorrect. |
403 Forbidden |
The server refused the request. |
The user does not have sufficient permissions. |
404 Not Found |
The requested resource does not exist. |
The requested resource (such as a container or object) does not exist. |
411 Length Required |
The request header did not contain the required Content-Length or Transfer-Encoding field. |
A request containing no Content-Length header is sent. |
412 Precondition Failed |
Conditions are not met. |
Conditions are not met, if the object query request contains the If-Match or If-None-Match header. |
413 Request Entity Too Large |
Insufficient user quota. |
User storage capacity exceeds user quota when uploading or replicating objects. |
A response header is the information appended to a response, as described in Table 8. Response headers describe the server and contain further information about accessing the requested resource.
Header |
Description |
Applicable To |
---|---|---|
Content-Length |
Length of a response body |
All responses (except those responses whose transfer-encoding is chunked) |
Date |
The date and time when a response was generated |
All responses |
X-Trans-Id |
A unique identifier generated by OBS (compatible with OpenStack Swift) for a request |
All responses |
Content-Type |
The object type returned |
All responses |
OBS (compatible with OpenStack Swift) normalizes the content of the Content-Type. The content returned is different from that returned by OpenStack Swift in the following way:
In OBS (compatible with OpenStack Swift), a response body is included in a request response under the following conditions:
If the object is not blank, the response body is the object body.
The response body describes the client error in detail in XML format so that the user can perform further operations. For details, see client error response codes.
The response body describes the server error in detail in XML format so that the user can perform further operations.
OBS (compatible with OpenStack Swift) returns an error response if a request is incorrect, the permission is incorrect, or the requested container or object is not found. An error response describes the error. When you upload an object, if permissions cannot be authenticated, the following information (in HTML format) is displayed:
<html><h1>Unauthorized</h1><p>This server could not verify that you are authorized to access the document you requested.</p></html>