doc-exports/docs/obs/api-swift/obs_03_0008.html
zhangyue 894279c39a Object Storage Service API Reference Swift V1
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2023-02-02 08:50:48 +00:00

60 lines
5.6 KiB
HTML

<a name="obs_03_0008"></a><a name="obs_03_0008"></a>
<h1 class="topictitle1">Request Methods</h1>
<div id="body3056034"><p id="obs_03_0008__p58889014">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, the authentication fields.</p>
<p id="obs_03_0008__p28909296">HTTP supports several HTTP request methods, such as GET, PUT, POST, DELETE, HEAD, and COPY. A request method indicates how to access specific resources. <a href="obs_03_0008.html#obs_03_0008__table55931017">Table 1</a> describes the request methods supported by REST APIs that are provided by OBS (compatible with OpenStack Swift).</p>
<div class="tablenoborder"><a name="obs_03_0008__table55931017"></a><a name="table55931017"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_03_0008__table55931017" frame="border" border="1" rules="all"><caption><b>Table 1 </b>REST request methods supported by OBS (compatible with OpenStack Swift)</caption><thead align="left"><tr id="obs_03_0008__row43512002"><th align="left" class="cellrowborder" valign="top" width="23.79%" id="mcps1.3.3.2.3.1.1"><p id="obs_03_0008__p34811256">Method</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="76.21%" id="mcps1.3.3.2.3.1.2"><p id="obs_03_0008__p1139524">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_03_0008__row25192587"><td class="cellrowborder" valign="top" width="23.79%" headers="mcps1.3.3.2.3.1.1 "><p id="obs_03_0008__p27333687">GET</p>
</td>
<td class="cellrowborder" valign="top" width="76.21%" headers="mcps1.3.3.2.3.1.2 "><p id="obs_03_0008__p66545072">Requests the server to return a specific resource, such as a container or object list or downloaded objects.</p>
</td>
</tr>
<tr id="obs_03_0008__row62034741"><td class="cellrowborder" valign="top" width="23.79%" headers="mcps1.3.3.2.3.1.1 "><p id="obs_03_0008__p58758091">PUT</p>
</td>
<td class="cellrowborder" valign="top" width="76.21%" headers="mcps1.3.3.2.3.1.2 "><p id="obs_03_0008__p61784930">Requests the server store a specific resource, such as a newly created container or uploaded objects.</p>
</td>
</tr>
<tr id="obs_03_0008__row19193461"><td class="cellrowborder" valign="top" width="23.79%" headers="mcps1.3.3.2.3.1.1 "><p id="obs_03_0008__p11166512">POST</p>
</td>
<td class="cellrowborder" valign="top" width="76.21%" headers="mcps1.3.3.2.3.1.2 "><p id="obs_03_0008__p32072255">Requests the server to modify a specific resource, such as a container or object metadata.</p>
</td>
</tr>
<tr id="obs_03_0008__row20214842"><td class="cellrowborder" valign="top" width="23.79%" headers="mcps1.3.3.2.3.1.1 "><p id="obs_03_0008__p26789475">DELETE</p>
</td>
<td class="cellrowborder" valign="top" width="76.21%" headers="mcps1.3.3.2.3.1.2 "><p id="obs_03_0008__p22463828">Requests the server to delete a specific resource, for example, an object.</p>
</td>
</tr>
<tr id="obs_03_0008__row64416501"><td class="cellrowborder" valign="top" width="23.79%" headers="mcps1.3.3.2.3.1.1 "><p id="obs_03_0008__p50354060">HEAD</p>
</td>
<td class="cellrowborder" valign="top" width="76.21%" headers="mcps1.3.3.2.3.1.2 "><p id="obs_03_0008__p52147080">Requests the server to return the digest of a specific resource, for example, the object metadata.</p>
</td>
</tr>
<tr id="obs_03_0008__row7477386152536"><td class="cellrowborder" valign="top" width="23.79%" headers="mcps1.3.3.2.3.1.1 "><p id="obs_03_0008__p187614152536">COPY</p>
</td>
<td class="cellrowborder" valign="top" width="76.21%" headers="mcps1.3.3.2.3.1.2 "><p id="obs_03_0008__p15196741152536">Requests the server to copy a specific resource, for example, an object.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="obs_03_0008__section20832974"><h4 class="sectiontitle">Request Headers</h4><p id="obs_03_0008__p799618379388">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.</p>
</div>
<div class="section" id="obs_03_0008__section354231515409"><h4 class="sectiontitle">HTTP Request Rules</h4><ul id="obs_03_0008__ul1849211915409"><li id="obs_03_0008__li3221135115409">There can be no more than 90 HTTP headers. If the token header is included, there can only be 91.</li><li id="obs_03_0008__li2146670415409">All HTTP headers cannot exceed 4,096 bytes.</li><li id="obs_03_0008__li5898261315409">An HTTP request line cannot exceed 8,192 bytes.</li><li id="obs_03_0008__li6108146915409">An HTTP request cannot exceed 5 GB.<div class="note" id="obs_03_0008__note4865197515409"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_03_0008__p3521459415409">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.</p>
<p id="obs_03_0008__p29977592387">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.</p>
</div></div>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0006.html">Methods of Calling APIs</a></div>
</div>
</div>