Files
doc-exports/docs/obs/api-ref/obs_04_0007.html
weihongmin1 285f8e4a64 OBS API 0826 Version
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: weihongmin1 <weihongmin1@huawei.com>
Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
2025-10-28 10:02:29 +00:00

270 lines
27 KiB
HTML

<a name="obs_04_0007"></a><a name="obs_04_0007"></a>
<h1 class="topictitle1">Constructing a Request</h1>
<div id="body1540211758070"><p id="obs_04_0007__a43d1d1a130ea44338355338cae1cdf56">This section describes the structure of a REST API request.</p>
<div class="section" id="obs_04_0007__section1849899574"><h4 class="sectiontitle">Request URI</h4><p id="obs_04_0007__p61456874">OBS uses URI to locate specific buckets, objects, and their parameters. Use URIs when you want to operate resources.</p>
<p id="obs_04_0007__p16240961">The following provides a common URI format. The parameters in square brackets [ ] are optional.</p>
<p id="obs_04_0007__p12437161441413"><strong id="obs_04_0007__b111541655132712">protocol://<strong id="obs_04_0007__b6154155592713">[</strong>bucket.<strong id="obs_04_0007__b1915495512279">]</strong>domain[:port][/object][?param]</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0007__table40449485" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="obs_04_0007__row6511324"><th align="left" class="cellrowborder" valign="top" width="10.58%" id="mcps1.3.2.5.2.5.1.1"><p id="obs_04_0007__p57655222">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.91%" id="mcps1.3.2.5.2.5.1.2"><p id="obs_04_0007__p2353884482">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="8.469999999999999%" id="mcps1.3.2.5.2.5.1.3"><p id="obs_04_0007__p50358869">Mandatory (Yes/No)</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="71.04%" id="mcps1.3.2.5.2.5.1.4"><p id="obs_04_0007__p39561425">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0007__row52536552"><td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.3.2.5.2.5.1.1 "><p id="obs_04_0007__p27602357">protocol</p>
</td>
<td class="cellrowborder" valign="top" width="9.91%" headers="mcps1.3.2.5.2.5.1.2 "><p id="obs_04_0007__p93538813488">String</p>
</td>
<td class="cellrowborder" valign="top" width="8.469999999999999%" headers="mcps1.3.2.5.2.5.1.3 "><p id="obs_04_0007__p39351575">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="71.04%" headers="mcps1.3.2.5.2.5.1.4 "><p id="obs_04_0007__p1641816571275"><strong id="obs_04_0007__b188516710390">Definition</strong>:</p>
<p id="obs_04_0007__p146571635172819">Protocol used for sending requests</p>
<p id="obs_04_0007__p101173374283"><strong id="obs_04_0007__b1590124283915">Constraints</strong>:</p>
<p id="obs_04_0007__p825815463285">None</p>
<p id="obs_04_0007__p1865315479284"><strong id="obs_04_0007__b10768154417398">Range</strong>:</p>
<ul id="obs_04_0007__ul9282191302920"><li id="obs_04_0007__li4282161372915">HTTP: HyperText Transfer Protocol. Data is transmitted in plaintext. It is easy to be eavesdropped and tampered with. It is usually used to transmit website content that does not contain sensitive information, such as news.</li><li id="obs_04_0007__li528211322918">HTTPS: HyperText Transfer Protocol Secure. Data is encrypted using SSL/TLS to provide secure and reliable communication. It is used to transmit sensitive information.</li></ul>
<p id="obs_04_0007__p172385152294"><strong id="obs_04_0007__b1989192612913">Default value</strong>:</p>
<p id="obs_04_0007__p4188141919297">None</p>
</td>
</tr>
<tr id="obs_04_0007__row88287534152"><td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.3.2.5.2.5.1.1 "><p id="obs_04_0007__p1930030181620">bucket</p>
</td>
<td class="cellrowborder" valign="top" width="9.91%" headers="mcps1.3.2.5.2.5.1.2 "><p id="obs_04_0007__p1035314817489">String</p>
</td>
<td class="cellrowborder" valign="top" width="8.469999999999999%" headers="mcps1.3.2.5.2.5.1.3 "><p id="obs_04_0007__p3300803163">No</p>
</td>
<td class="cellrowborder" valign="top" width="71.04%" headers="mcps1.3.2.5.2.5.1.4 "><p id="obs_04_0007__p1220104418140"><strong id="obs_04_0007__b18387693735458">Definition</strong>:</p>
<p id="obs_04_0007__p11806458112815">Bucket name</p>
<p id="obs_04_0007__p122939219202"><strong id="obs_04_0007__b958121802115">Constraints</strong>:</p>
<ul id="obs_04_0007__ul198067588284"><li id="obs_04_0007__li9806115817284">A bucket name must be unique across all accounts and regions.</li><li id="obs_04_0007__li178061586282">A bucket name:<ul id="obs_04_0007__ul1280665811281"><li id="obs_04_0007__li1980635842820">Must be 3 to 63 characters long and start with a digit or letter. Lowercase letters, digits, hyphens (-), and periods (.) are allowed.</li><li id="obs_04_0007__li880685832818">Cannot be formatted as an IP address.</li><li id="obs_04_0007__li1780685882815">Cannot start or end with a hyphen (-) or period (.).</li><li id="obs_04_0007__li15806165820287">Cannot contain two consecutive periods (..), for example, <strong id="obs_04_0007__b20321870205458">my..bucket</strong>.</li><li id="obs_04_0007__li580610584285">Cannot contain a period (.) and a hyphen (-) adjacent to each other, for example, <strong id="obs_04_0007__b6450327305458">my-.bucket</strong> or <strong id="obs_04_0007__b20190343275458">my.-bucket</strong>.</li></ul>
</li><li id="obs_04_0007__li480615588283">If you repeatedly create buckets of the same name in the same region, no error will be reported and the bucket attributes comply with those set in the first creation request.</li></ul>
<p id="obs_04_0007__p38154238"><strong id="obs_04_0007__b146281599520">Default value</strong>:</p>
<p id="obs_04_0007__p413645165313">None</p>
</td>
</tr>
<tr id="obs_04_0007__row55346801513"><td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.3.2.5.2.5.1.1 "><p id="obs_04_0007__p135344812156">domain</p>
</td>
<td class="cellrowborder" valign="top" width="9.91%" headers="mcps1.3.2.5.2.5.1.2 "><p id="obs_04_0007__p535398154819">String</p>
</td>
<td class="cellrowborder" valign="top" width="8.469999999999999%" headers="mcps1.3.2.5.2.5.1.3 "><p id="obs_04_0007__p125929367153">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="71.04%" headers="mcps1.3.2.5.2.5.1.4 "><p id="obs_04_0007__p7796143117364"><strong id="obs_04_0007__b9362103714416">Definition</strong>:</p>
<p id="obs_04_0007__p323103261516">Endpoint of each region, for example, <strong id="obs_04_0007__b18385204019411">obs.</strong><em id="obs_04_0007__i9385540104119">region</em><strong id="obs_04_0007__b038516402419">.example.com</strong></p>
<p id="obs_04_0007__p914411119393"><strong id="obs_04_0007__b14627843124113">Constraints</strong>:</p>
<p id="obs_04_0007__p1167411126395">None</p>
<p id="obs_04_0007__p61449119399"><strong id="obs_04_0007__b114401111394">Default value</strong>:</p>
<p id="obs_04_0007__p4501326124017">None</p>
</td>
</tr>
<tr id="obs_04_0007__row53201908"><td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.3.2.5.2.5.1.1 "><p id="obs_04_0007__p14387307">port</p>
</td>
<td class="cellrowborder" valign="top" width="9.91%" headers="mcps1.3.2.5.2.5.1.2 "><p id="obs_04_0007__p163531484481">String</p>
</td>
<td class="cellrowborder" valign="top" width="8.469999999999999%" headers="mcps1.3.2.5.2.5.1.3 "><p id="obs_04_0007__p14294078">No</p>
</td>
<td class="cellrowborder" valign="top" width="71.04%" headers="mcps1.3.2.5.2.5.1.4 "><p id="obs_04_0007__p579384616366"><strong id="obs_04_0007__b253613548412">Definition</strong>:</p>
<p id="obs_04_0007__p19824143884010">Port enabled for sending requests. The value varies with software server deployment.</p>
<p id="obs_04_0007__p17816653163614"><strong id="obs_04_0007__b347381204213">Constraints</strong>:</p>
<p id="obs_04_0007__p175041248114019">None</p>
<p id="obs_04_0007__p9246205913615"><strong id="obs_04_0007__b1251916414218">Range</strong>:</p>
<p id="obs_04_0007__p1945915315415">In OBS, the default HTTP port is <strong id="obs_04_0007__b13167373425">80</strong> and that of HTTPS is <strong id="obs_04_0007__b191684724218">443</strong>.</p>
<p id="obs_04_0007__p55641952371"><strong id="obs_04_0007__b556515511370">Default value</strong>:</p>
<p id="obs_04_0007__p24521247">If no port number is specified, the protocol uses the default value. Each transmission protocol has its default port number.</p>
</td>
</tr>
<tr id="obs_04_0007__row35289195"><td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.3.2.5.2.5.1.1 "><p id="obs_04_0007__p39852543">object</p>
</td>
<td class="cellrowborder" valign="top" width="9.91%" headers="mcps1.3.2.5.2.5.1.2 "><p id="obs_04_0007__p15353178164815">String</p>
</td>
<td class="cellrowborder" valign="top" width="8.469999999999999%" headers="mcps1.3.2.5.2.5.1.3 "><p id="obs_04_0007__p16406130">No</p>
</td>
<td class="cellrowborder" valign="top" width="71.04%" headers="mcps1.3.2.5.2.5.1.4 "><p id="obs_04_0007__en-us_topic_0265897644_p19847193395017"><strong id="obs_04_0007__en-us_topic_0265897644_b984717335507">Definition</strong>:</p>
<p id="obs_04_0007__en-us_topic_0265897644_p568755118152">Object name. An object is uniquely identified by an object name in a bucket. An object name is a complete path that does not contain the bucket name.</p>
<p id="obs_04_0007__p2165747102420">For example, if the access path is <strong id="obs_04_0007__b20738952151515">examplebucket.obs.</strong><strong id="obs_04_0007__b1593615587153">eu-de.otc.t-systems.com</strong><strong id="obs_04_0007__b93855519168">/folder/test.txt</strong>, the object name is <strong id="obs_04_0007__b184012517161">folder/test.txt</strong>.</p>
<p id="obs_04_0007__en-us_topic_0265897644_p198471833135015"><strong id="obs_04_0007__en-us_topic_0265897644_b1684719331506">Range</strong>:</p>
<p id="obs_04_0007__en-us_topic_0265897644_p8926340131620">The value is a string of 1 to 1024 characters.</p>
<p id="obs_04_0007__en-us_topic_0265897644_p9847143320504"><strong id="obs_04_0007__en-us_topic_0265897644_b48470333502">Default value</strong>:</p>
<p id="obs_04_0007__en-us_topic_0265897644_p123955911715">None</p>
</td>
</tr>
<tr id="obs_04_0007__row13437443"><td class="cellrowborder" valign="top" width="10.58%" headers="mcps1.3.2.5.2.5.1.1 "><p id="obs_04_0007__p14691104">param</p>
</td>
<td class="cellrowborder" valign="top" width="9.91%" headers="mcps1.3.2.5.2.5.1.2 "><p id="obs_04_0007__p9353580486">String</p>
</td>
<td class="cellrowborder" valign="top" width="8.469999999999999%" headers="mcps1.3.2.5.2.5.1.3 "><p id="obs_04_0007__p45866588">No</p>
</td>
<td class="cellrowborder" valign="top" width="71.04%" headers="mcps1.3.2.5.2.5.1.4 "><p id="obs_04_0007__p12765915203711"><strong id="obs_04_0007__b1166510211429">Definition</strong>:</p>
<p id="obs_04_0007__p69725175456">Requested bucket and object</p>
<p id="obs_04_0007__p1176511151377"><strong id="obs_04_0007__b360832514421">Constraints</strong>:</p>
<p id="obs_04_0007__p125176204612">None</p>
<p id="obs_04_0007__p57651515123716"><strong id="obs_04_0007__b2075252715424">Range</strong>:</p>
<p id="obs_04_0007__p0181136164610">None</p>
<p id="obs_04_0007__p105285074610"><strong id="obs_04_0007__b185291902466">Default value</strong>:</p>
<p id="obs_04_0007__p13765715153710">If this parameter is not set, the bucket or object involved in the request is used by default.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="notice" id="obs_04_0007__note449230598"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="obs_04_0007__p169401149185116">All API requests except those for the bucket list must contain the bucket name. Based on the DNS resolution performance and reliability, OBS requires that the bucket name must be placed in front of the <strong id="obs_04_0007__b321515165217">domain</strong> when a request carrying a bucket name is constructed to form a third-level domain name, also mentioned as virtual hosting access domain name.</p>
<p id="obs_04_0007__p3688185011212">For example, you have a bucket named <strong id="obs_04_0007__b31131019248">test-bucket</strong> in the <strong id="obs_04_0007__b152410132414">a1</strong> region, and you want to access the ACL of an object named <strong id="obs_04_0007__b63151016247">test-object</strong> in the bucket. The correct URL is <strong id="obs_04_0007__b1831210172414">https://test-bucket.obs.a1.example.com/test-object?acl</strong>.</p>
</div></div>
</div>
<div class="section" id="obs_04_0007__section580035055419"><h4 class="sectiontitle">Request Method</h4><p id="obs_04_0007__p65661618145510">HTTP methods, which are also called operations or actions, specify the type of operations that you are requesting.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0007__table1123134922518" frame="border" border="1" rules="all"><caption><b>Table 2 </b>HTTP request methods supported by the OBS</caption><thead align="left"><tr id="obs_04_0007__row65706590"><th align="left" class="cellrowborder" valign="top" width="15.15%" id="mcps1.3.3.3.2.3.1.1"><p id="obs_04_0007__p20633546">Method</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="84.85000000000001%" id="mcps1.3.3.3.2.3.1.2"><p id="obs_04_0007__p60704555">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0007__row18121961"><td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.3.3.2.3.1.1 "><p id="obs_04_0007__p58592747">GET</p>
</td>
<td class="cellrowborder" valign="top" width="84.85000000000001%" headers="mcps1.3.3.3.2.3.1.2 "><p id="obs_04_0007__p48392090">Requests that the server return a specific resource, for example, a bucket list or object.</p>
</td>
</tr>
<tr id="obs_04_0007__row32875629"><td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.3.3.2.3.1.1 "><p id="obs_04_0007__p45680330">PUT</p>
</td>
<td class="cellrowborder" valign="top" width="84.85000000000001%" headers="mcps1.3.3.3.2.3.1.2 "><p id="obs_04_0007__p9119239">Requests that the server update a specific resource, for example, creating a bucket or uploading an object.</p>
</td>
</tr>
<tr id="obs_04_0007__row14964289"><td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.3.3.2.3.1.1 "><p id="obs_04_0007__p4147890">POST</p>
</td>
<td class="cellrowborder" valign="top" width="84.85000000000001%" headers="mcps1.3.3.3.2.3.1.2 "><p id="obs_04_0007__p434775">Requests that the server add a resource or perform a special operation, for example, initiating multipart uploads or assembling parts.</p>
</td>
</tr>
<tr id="obs_04_0007__row35216792"><td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.3.3.2.3.1.1 "><p id="obs_04_0007__p33987935">DELETE</p>
</td>
<td class="cellrowborder" valign="top" width="84.85000000000001%" headers="mcps1.3.3.3.2.3.1.2 "><p id="obs_04_0007__p1559313">Requests that the server delete specified resources, for example, an object.</p>
</td>
</tr>
<tr id="obs_04_0007__row14033823"><td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.3.3.2.3.1.1 "><p id="obs_04_0007__p62997855">HEAD</p>
</td>
<td class="cellrowborder" valign="top" width="84.85000000000001%" headers="mcps1.3.3.3.2.3.1.2 "><p id="obs_04_0007__p2552640">Requests that the server return the description of a specific resource, for example, object metadata.</p>
</td>
</tr>
<tr id="obs_04_0007__row22973764"><td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.3.3.2.3.1.1 "><p id="obs_04_0007__p48935609">OPTIONS</p>
</td>
<td class="cellrowborder" valign="top" width="84.85000000000001%" headers="mcps1.3.3.3.2.3.1.2 "><p id="obs_04_0007__p4361378">Requests that the server check whether the user has the operation permission for a resource. The CORS needs to be configured for the bucket.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0007__section1454211155819"><h4 class="sectiontitle">Request Headers</h4><p id="obs_04_0007__p155521124165511">Refers to optional and additional request fields, for example a field required by a specific URI or HTTP method. For details about the fields of common request headers, see <a href="#obs_04_0007__table25197309">Table 3</a>.</p>
<div class="tablenoborder"><a name="obs_04_0007__table25197309"></a><a name="table25197309"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0007__table25197309" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Common request headers</caption><thead align="left"><tr id="obs_04_0007__row56260471"><th align="left" class="cellrowborder" valign="top" width="13.508649135086493%" id="mcps1.3.4.3.2.5.1.1"><p id="obs_04_0007__p60804269">Header</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.729027097290272%" id="mcps1.3.4.3.2.5.1.2"><p id="obs_04_0007__p11541111914613">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.129087091290872%" id="mcps1.3.4.3.2.5.1.3"><p id="obs_04_0007__p1454210164712">Mandatory (Yes/No)</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="67.63323667633236%" id="mcps1.3.4.3.2.5.1.4"><p id="obs_04_0007__p26198756">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0007__row24239987"><td class="cellrowborder" valign="top" width="13.508649135086493%" headers="mcps1.3.4.3.2.5.1.1 "><p id="obs_04_0007__p17281948">Authorization</p>
</td>
<td class="cellrowborder" valign="top" width="9.729027097290272%" headers="mcps1.3.4.3.2.5.1.2 "><p id="obs_04_0007__p16541719194618">String</p>
</td>
<td class="cellrowborder" valign="top" width="9.129087091290872%" headers="mcps1.3.4.3.2.5.1.3 "><p id="obs_04_0007__p13541110174719">Conditionally Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.63323667633236%" headers="mcps1.3.4.3.2.5.1.4 "><p id="obs_04_0007__p6143103214470"><strong id="obs_04_0007__b17304196194313">Definition</strong>:</p>
<p id="obs_04_0007__p1739351515487">Signature information contained in a request message</p>
<p id="obs_04_0007__p014373215478"><strong id="obs_04_0007__b10470101410185">Constraints</strong>:</p>
<p id="obs_04_0007__p287318183488">This header is optional for anonymous requests and is mandatory for other requests.</p>
<p id="obs_04_0007__p81435328472"><strong id="obs_04_0007__b7342172281815">Range</strong>:</p>
<p id="obs_04_0007__p19777122815483">None</p>
<p id="obs_04_0007__p414393215477"><strong id="obs_04_0007__b114323212474">Default value</strong>:</p>
<p id="obs_04_0007__p11431432104719">None</p>
</td>
</tr>
<tr id="obs_04_0007__row47562386"><td class="cellrowborder" valign="top" width="13.508649135086493%" headers="mcps1.3.4.3.2.5.1.1 "><p id="obs_04_0007__p27348077">Content-Length</p>
</td>
<td class="cellrowborder" valign="top" width="9.729027097290272%" headers="mcps1.3.4.3.2.5.1.2 "><p id="obs_04_0007__p4541101913463">String</p>
</td>
<td class="cellrowborder" valign="top" width="9.129087091290872%" headers="mcps1.3.4.3.2.5.1.3 "><p id="obs_04_0007__p1354191084716">Conditionally Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.63323667633236%" headers="mcps1.3.4.3.2.5.1.4 "><p id="obs_04_0007__p1336065374711"><strong id="obs_04_0007__b05571423162312">Definition</strong>:</p>
<p id="obs_04_0007__p601777">Length of a message (excluding the message header).</p>
<p id="obs_04_0007__p1936025354716"><strong id="obs_04_0007__b97419248">Constraints</strong>:</p>
<p id="obs_04_0007__p14126104217482">It is optional for the PUT operation and mandatory for the operation of loading XML files.</p>
<p id="obs_04_0007__p736025324718"><strong id="obs_04_0007__b105111115112418">Range</strong>:</p>
<p id="obs_04_0007__p6816154814485">None</p>
<p id="obs_04_0007__p15360175310479"><strong id="obs_04_0007__b123601553194712">Default value</strong>:</p>
<p id="obs_04_0007__p1713255314481">None</p>
</td>
</tr>
<tr id="obs_04_0007__row35259646"><td class="cellrowborder" valign="top" width="13.508649135086493%" headers="mcps1.3.4.3.2.5.1.1 "><p id="obs_04_0007__p37459059">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="9.729027097290272%" headers="mcps1.3.4.3.2.5.1.2 "><p id="obs_04_0007__p1054111994615">String</p>
</td>
<td class="cellrowborder" valign="top" width="9.129087091290872%" headers="mcps1.3.4.3.2.5.1.3 "><p id="obs_04_0007__p954121034720">No</p>
</td>
<td class="cellrowborder" valign="top" width="67.63323667633236%" headers="mcps1.3.4.3.2.5.1.4 "><p id="obs_04_0007__p196687566479"><strong id="obs_04_0007__b5156202092419">Definition</strong>:</p>
<p id="obs_04_0007__p73459245494">The content type of the requested resource, for example, <strong id="obs_04_0007__b175492953691511">text</strong>/<strong id="obs_04_0007__b184343293591511">plain</strong></p>
<p id="obs_04_0007__p1466819563477"><strong id="obs_04_0007__b012193010245">Constraints</strong>:</p>
<p id="obs_04_0007__p17180115404915">None</p>
<p id="obs_04_0007__p12668125664710"><strong id="obs_04_0007__b156681756154717">Default value</strong>:</p>
<p id="obs_04_0007__p14284953">If this header is not carried when an object is uploaded, the value of Content-Type returned by default when the object is downloaded is binary/octet-stream.</p>
</td>
</tr>
<tr id="obs_04_0007__row20912334"><td class="cellrowborder" valign="top" width="13.508649135086493%" headers="mcps1.3.4.3.2.5.1.1 "><p id="obs_04_0007__p16177456">Date</p>
</td>
<td class="cellrowborder" valign="top" width="9.729027097290272%" headers="mcps1.3.4.3.2.5.1.2 "><p id="obs_04_0007__p17541141912466">String</p>
</td>
<td class="cellrowborder" valign="top" width="9.129087091290872%" headers="mcps1.3.4.3.2.5.1.3 "><p id="obs_04_0007__p1254111012474">Conditionally Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.63323667633236%" headers="mcps1.3.4.3.2.5.1.4 "><p id="obs_04_0007__p12228175912473"><strong id="obs_04_0007__b6507123212260">Definition</strong>:</p>
<p id="obs_04_0007__p4585455135319">Time when a request is initiated, for example, <strong id="obs_04_0007__b17381488565458">Wed, 27 Jun 2018 13:39:15 +0000</strong></p>
<p id="obs_04_0007__p1322915974711"><strong id="obs_04_0007__b3676144816266">Constraints</strong>:</p>
<p id="obs_04_0007__p1850071195417">This header is optional for anonymous requests or requests whose headers contain the <strong id="obs_04_0007__b799270162712">x-obs-date</strong> field and mandatory for other requests.</p>
<p id="obs_04_0007__p12291059104719"><strong id="obs_04_0007__b1684510102716">Range</strong>:</p>
<p id="obs_04_0007__p2621812135418">None</p>
<p id="obs_04_0007__p622914593473"><strong id="obs_04_0007__b722913594474">Default value</strong>:</p>
<p id="obs_04_0007__p35305575">None</p>
</td>
</tr>
<tr id="obs_04_0007__row64573848"><td class="cellrowborder" valign="top" width="13.508649135086493%" headers="mcps1.3.4.3.2.5.1.1 "><p id="obs_04_0007__p63099185">Host</p>
</td>
<td class="cellrowborder" valign="top" width="9.729027097290272%" headers="mcps1.3.4.3.2.5.1.2 "><p id="obs_04_0007__p654131919465">String</p>
</td>
<td class="cellrowborder" valign="top" width="9.129087091290872%" headers="mcps1.3.4.3.2.5.1.3 "><p id="obs_04_0007__p85420107478">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67.63323667633236%" headers="mcps1.3.4.3.2.5.1.4 "><p id="obs_04_0007__p10837532488"><strong id="obs_04_0007__b121971815182712">Definition</strong>:</p>
<p id="obs_04_0007__p5506622181019">Access domain name of a bucket. The format is <i><span class="varname" id="obs_04_0007__varname187881447102">BucketName</span></i><strong id="obs_04_0007__b5954134152710">.</strong><i><span class="varname" id="obs_04_0007__varname135461850111016">Endpoint</span></i>, for example, <strong id="obs_04_0007__b1047434819278">obs.</strong><em id="obs_04_0007__i42262524177">region</em><strong id="obs_04_0007__b1017419450277">.example.com</strong>.</p>
<p id="obs_04_0007__p97201251192612">Example: examplebucketname.obs.<em id="obs_04_0007__i9720451112616">region</em>.example.com</p>
<p id="obs_04_0007__p1383712315483"><strong id="obs_04_0007__b1175915112287">Constraints</strong>:</p>
<p id="obs_04_0007__p57821140145412">The constraints on bucket names are as follows:</p>
<ul id="obs_04_0007__ul132384691220"><li id="obs_04_0007__li15323134641220">A bucket name must be unique across all accounts and regions.</li><li id="obs_04_0007__li732324618124">A bucket name:<ul id="obs_04_0007__ul183231846111216"><li id="obs_04_0007__li0323104651214">Must be 3 to 63 characters long and start with a digit or letter. Lowercase letters, digits, hyphens (-), and periods (.) are allowed.</li><li id="obs_04_0007__li183231646101211">Cannot be formatted as an IP address.</li><li id="obs_04_0007__li932316466129">Cannot start or end with a hyphen (-) or period (.).</li><li id="obs_04_0007__li7323846171214">Cannot contain two consecutive periods (..), for example, <strong id="obs_04_0007__b3811548155458">my..bucket</strong>.</li><li id="obs_04_0007__li332317469120">Cannot contain a period (.) and a hyphen (-) adjacent to each other, for example, <strong id="obs_04_0007__b8607188615458">my-.bucket</strong> or <strong id="obs_04_0007__b15396707085458">my.-bucket</strong>.</li></ul>
</li><li id="obs_04_0007__li18323194616125">If you repeatedly create buckets of the same name in the same region, no error will be reported and the bucket attributes comply with those set in the first creation request.</li></ul>
<p id="obs_04_0007__p7968173525418"><strong id="obs_04_0007__b16969735105416">Default value</strong>:</p>
<p id="obs_04_0007__p883816319487">None</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0007__section14612192315587"><h4 class="sectiontitle">(Optional) Request Body</h4><p id="obs_04_0007__p23132011213">A request body is generally sent in a structured format (for example, JSON or XML). It corresponds to <strong id="obs_04_0007__b367972613329">Content-Type</strong> in the request header and is used to transfer content other than the request header. If the request body contains full-width characters, these characters must be coded using UTF-8.</p>
<p id="obs_04_0007__p43235913117">The request body varies according to the APIs. Certain APIs do not require the request body, such as the GET and DELETE APIs.</p>
</div>
<div class="section" id="obs_04_0007__section140743661613"><h4 class="sectiontitle">Sending a Request</h4><p id="obs_04_0007__abe87411d02f441d8acf5a5f63d52edbe">There are two methods to initiate requests based on the constructed request messages:</p>
<ul id="obs_04_0007__u69bb0fd8d11a4e428f4e6fedc1515950"><li id="obs_04_0007__la8e5f209e37b4c9eb0ae66f73d0ec1f0">cURL<p id="obs_04_0007__a04f9f8ebd6674f36b25f63e65a92dcf2"><a name="obs_04_0007__la8e5f209e37b4c9eb0ae66f73d0ec1f0"></a><a name="la8e5f209e37b4c9eb0ae66f73d0ec1f0"></a>cURL is a command-line tool used to perform URL operations and transmit information. cURL acts as an HTTP client that can send HTTP requests to the server and receive response messages. cURL is applicable to API debugging. For more information about cURL, visit <a href="https://curl.haxx.se/" target="_blank" rel="noopener noreferrer">https://curl.haxx.se/</a>. cURL cannot calculate signatures. When cURL is used, only anonymous public OBS resources can be accessed.</p>
</li><li id="obs_04_0007__lae3f7b6d508b43cd8565d0e8c4d9700b">Coding<p id="obs_04_0007__a02b0199016c4467693bc9cd4dcd9d74f"><a name="obs_04_0007__lae3f7b6d508b43cd8565d0e8c4d9700b"></a><a name="lae3f7b6d508b43cd8565d0e8c4d9700b"></a>You can use code to make API calls, and to assemble, send, and process request messages. It can be implemented by using the SDK or coding.</p>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0006.html">Calling APIs</a></div>
</div>
</div>