本文へジャンプします。

ニフクラ ユーザーガイド

本ページは2023/9/5をもって、新ページhttps://docs.nifcloud.com/object-storage-service/api/PutBucketCors.htmへ移行しました。 今後は新ページをご参照ください。

PutBucketCors

処理概要

バケットにCors(Cross-Origin Resource Sharing)構成情報を設定します。

リクエストURL

PUT /{Bucket}?cors

指定するパラメーター

ヘッダーパラメーター
パラメーター 型 説明 必須
x-amz-content-sha256 string ペイロード全体の計算されたSHA256チェックサム
○
x-amz-date string リクエスト側で生成した現在日時
○
Authorization string リクエスト認証に用いる文字列
○
Content-Length string リクエストボディのバイト数
○
パスパラメーター
パラメーター 型 説明 必須
Bucket string バケット名
○
リクエストボディ
パラメーター 型 説明 必須
CORSConfiguration structure CORSRules要素用のコンテナ
○
␣CORSRule list クロスサイトリクエストを許可するための条件
○
␣␣ID string 条件設定を一意に識別するためのID
␣␣AllowedOrigin string クロスサイトリクエストを許可するオリジン
○
␣␣AllowedHeader string クロスサイトリクエストに含めることができるヘッダ
␣␣AllowedMethod string[] クロスサイトリクエストで許可するHTTPメソッド
○
␣␣MaxAgeSeconds integer プリフライトリクエストをブラウザでキャッシュできる時間
␣␣ExposeHeader string Access-Control-Expose-Headers としてクライアント に示すクロスサイトリクエストで指定可能なヘッダ

応答フィールド

レスポンスヘッダー
フィールド (項目) 型 説明
Date string トランザクションが実行された日時
Content-Length string レスポンスボディのバイト数
Connection string 持続接続の状態を表示します。
x-amz-request-id string

このリクエストに付与されるID
トラブルについて問い合わせる際に利用されます。


x-amz-id-2 string

このリクエストに対する処理ID
トラブルについて問い合わせる際に利用されます。


x-ntap-sg-trace-id string

このリクエストに対する処理ID
トラブルについて問い合わせる際に利用されます。


X-Fcx-Endpoint-Request string APIエンドポイントとしてリクエストを受け付けたことを示す番号

リクエストサンプル

    PUT /general-bucket?cors HTTP/1.1
User-Agent: curl/7.29.0
Host: jp-east-1.storage.api.nifcloud.com
Accept: */*
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20190604T022452Z
Authorization:AWS4-HMAC-SHA256 Credential=XK8Z3830NBL1BT9WD3HD/20190604/jp-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=ba9e9550ce44df39135e9eb15d355427841546f6e9725c722ca7041c24fba893
Content-Length: 557
Content-Type: application/x-www-form-urlencoded

<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <CORSRule>
    <AllowedOrigin>http://www.example.com</AllowedOrigin>
    <AllowedHeader>*</AllowedHeader>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <ExposeHeader>x-amz-server-side-encryption</ExposeHeader>
  </CORSRule>
  <CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedHeader>Authorization</AllowedHeader>
    <AllowedMethod>GET</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
  </CORSRule>
</CORSConfiguration>

  

応答サンプル

    HTTP/1.1 200 OK
Date: Tue, 04 Jun 2019 02:25:02 GMT
Content-Length: 0
Connection: keep-alive
x-amz-request-id: 322948696
x-amz-id-2: 12174498
x-ntap-sg-trace-id: a885941abae2bd0c
X-Fcx-Endpoint-Request: EXECUTED_api2-rmp1.management.jp-east-1.local-28163-754038-1_200

  
  • ※本ページ記載の金額は、すべて税抜表示です。
  • ※本ページ記載の他社製品名および会社名などは、各社の商標または登録商標です。
  • ※本ページの内容は、2023年9月05日時点の情報です。

推奨画面サイズ 1024×768 以上