HTTP 302

HTTPレスポンスステータスコード302Foundは、 URLリダイレクトを実行する一般的な方法。 HTTP/1.0 仕様 (RFC 1945) は当初この�…

HTTP 302

HTTPレスポンスステータスコード302Foundは、 URLリダイレクトを実行する一般的な方法。 HTTP/1.0 仕様 (RFC 1945) は当初このコードを定義し、「Found」ではなく「Moved Temporarily」という説明文を与えていた。

このステータスコードを含むHTTP応答は、ヘッダーフィールドロケーションにURLを追加で提供する。これは、ユーザーエージェント(例えばWebブラウザ)に対して、ロケーションフィールドで指定された新しいURLへの2回目のリクエストを行うように招待するものである。最終的には、新しいURLへのリダイレクトが行われる。

多くのWebブラウザーは本来POST_(HTTP)であるべきリクエストのタイプをGETに変更するなどの標準に違反する方法で実装した[1]。このため、HTTP / 1.1( RFC 2616)は新しいステータスコード303と307を追加することによって2つの動作を明確にし、303は要求タイプの変更をGETに義務付け、307は最初に送信されたままの要求タイプを保持するようにしている。この曖昧性の解消によって明確化されたにもかかわらず、HTTP/1.1 仕様を実装していないブラウザとの互換性を維持するために302フレームワークは302は依然ウェブフレームワークで採用されている[2]

クライアントのリクエスト:

GET /index.html HTTP/1.1
Host: www.example.com

サーバーの応答:

HTTP/1.1 302 Found
Location: http://www.iana.org/domains/example/

関連項目

参考文献

  1. ^ Lawrence. “HTTP Methods and Redirect Status Codes”. EricLaw's IEInternals blog. 2011年8月20日閲覧。
  2. ^ Request and response objects | Django documentation | Django”. Docs.djangoproject.com. 2014年6月23日閲覧。

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.