[309] 307
(Temporary Redirect) は、
同じ要求メソッドで別の URL にアクセスするべきことを表す状態符号です。
HTTPリダイレクトの一種です。
[310] 307
は、対象資源が一時的に異なる URL
にあり、利用者エージェントはその URL に自動的にリダイレクトする場合には要求メソッドを変更してはならないことを表しています
>>308。
[311] リダイレクトは後から変わるかもしれませんから、 クライアントは以後の要求でも元の実効要求URL を使い続けるべきです >>308。
[313] 鯖は、異なる URL を含む Location:
ヘッダーを生成するべきです >>308。
[316] payload は通常リダイレクト先 URL へのハイパーリンクを含む短いハイパーテキストのメモを含みます >>308。
[314] 利用者エージェントは、 Location:
ヘッダーの値を自動的なリダイレクトに使って構いません >>308。
[2] この応答符号は 302
が濫用されてきたために新設されました。その辺の事情の説明はリダイレクトを参照してください。
The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.
要求された資源は一時的に異なる URI のもとにあります。
再指向は時節により変わっても構わないので、
クライアントは将来の要求に対しても(訳注)元の要求に使った
Request-URI
を使い続けるべきです。
この応答は、 Cache-Control
頭欄又は
Expires
頭欄で示された場合のみキャッシュ可能です。
The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI.
一時 URI は応答の Location
欄で与えるべきです。
要求の method が HEAD
でない限り、応答の実体は新しい URI (群)
へのハイパーリンクの入った短いハイパーテキスト覚書を含むべきです。
なぜなら多くの HTTP/1.1 以前の利用者エージェントは 307
状態を理解しません。
従って、覚書は利用者が元の要求を新しい URI
に対して繰り返す必要があるという情報を含めるべきです。
If the 307 status code is received in response to a request
{2616} other than GET or HEAD{errata} method that is known to be "safe", as defined in section 9.1.1, then the request MAY be automatically redirected by the user agent without confirmation. Otherwise, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
安全であると分かっている method の要求に対する応答で
307
状態符号を受取った時は、
利用者エージェントは要求を確認なしに自動的に redirect
しても構いません。そうでない場合は、
利用者エージェントは利用者の確認を得ずに要求を自動的に再指向してはなりません。
再指向によって要求が発行された条件が変わってしまうかもしれないからです。
[1] [Errata] http://purl.org/NET/http-errata#saferedirect
TEMPORARY_REDIRECT (307)
[6] Avoid using the CORS flag to reset request's origin in redirects by annevk · Pull Request #594 · whatwg/fetch () https://github.com/whatwg/fetch/pull/594
302
が使われるため、307
は滅多に見られません。