メインコンテンツまでスキップ

4. Example (例)

クライアントは "compress" Content Coding ([RFC7231] 第 3.1.2.1 節) を用いて POST リクエストを送る:

POST /edit/ HTTP/1.1
Host: example.org
Content-Type: application/atom+xml;type=entry
Content-Encoding: compress

...compressed payload...

サーバーは "gzip" Content Coding のみを許可するため, リクエストを拒否する:

HTTP/1.1 415 Unsupported Media Type
Date: Fri, 09 May 2014 11:43:53 GMT
Accept-Encoding: gzip
Content-Length: 68
Content-Type: text/plain

This resource only supports the "gzip" content coding in requests.

この時点で, クライアントはサポートされる "gzip" Content Coding でリクエストを再試行できる.

別例として, リクエストでいかなる Content Coding もサポートしないサーバーは次のように応答できる:

HTTP/1.1 415 Unsupported Media Type
Date: Fri, 09 May 2014 11:43:53 GMT
Accept-Encoding: identity
Content-Length: 61
Content-Type: text/plain

This resource does not support content codings in requests.