第 5 回 の 内 容 HTTPの 規 格 HTTPメッセージの 基 本
HTTPの 規 格
HTTPの 規 格 Internet Engineering Task Force (IETF) Request for Comments (RFC) 年 バージョン RFC 1996 年 HTTP/1.0 RFC 1945 Hypertext Transfer Protocol -- HTTP/1.0 1997 年 HTTP/1.1 RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1 1999 年 HTTP/1.1 ( 改 訂 版 ) RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1
RFC 2616の 改 訂 RFC 7230 Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing RFC 7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content RFC 7232 Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests RFC 7233 Hypertext Transfer Protocol (HTTP/1.1): Range Requests RFC 7234 Hypertext Transfer Protocol (HTTP/1.1): Caching RFC 7235 Hypertext Transfer Protocol (HTTP/1.1): Authentication
RFC 内 容 RFC URI RFC 3986 Uniform Resource Identifier (URI): Generic Syntax HTTP 認 証 RFC 2617 HTTP Authentication: Basic and Digest Access Authentication RFC 7235 Hypertext Transfer Protocol (HTTP/1.1): Authentication CGI RFC 3875 The Common Gateway Interface (CGI) Version 1.1 クッキー RFC 6265 HTTP State Management Mechanism
HTTPメッセージの 基 本
HTTPメッセージの 構 造 リクエストメッセージ リクエストライン メッセージヘッダ レスポンスメッセージ ステータスライン メッセージヘッダ 空 行 メッセージボディ 空 行 メッセージボディ
メッセージヘッダ フィールド 名 : フィールド 値 Content-Type: text/html; charset=utf-8 フィールド 名 フィールド 値
リクエストメッセージの 例 リクエストライン メッセージヘッダ GET /test.html HTTP/1.1 Host: www.example.ac.jp 空 行 メッセージボディ
リクエストメッセージの 例 リクエストライン メッセージヘッダ GET /test.html HTTP/1.1 Host: www.example.ac.jp 空 行 メッセージボディ
リクエストメッセージの 例 リクエストライン メッセージヘッダ GET /test.html HTTP/1.1 Host: www.example.ac.jp 空 行 メッセージボディ
リクエストメッセージの 例 リクエストライン メッセージヘッダ GET /test.html HTTP/1.1 Host: www.example.ac.jp 空 行 メッセージボディ
リクエストメッセージの 例 リクエストライン メッセージヘッダ GET /test.html HTTP/1.1 Host: www.example.ac.jp 空 行 メッセージボディ
レスポンスメッセージの 例 ステータスライン メッセージヘッダ 空 行 メッセージボディ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
レスポンスメッセージの 例 ステータスライン メッセージヘッダ 空 行 メッセージボディ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
レスポンスメッセージの 例 ステータスライン メッセージヘッダ 空 行 メッセージボディ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
レスポンスメッセージの 例 ステータスライン メッセージヘッダ 空 行 メッセージボディ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
レスポンスメッセージの 例 ステータスライン メッセージヘッダ 空 行 メッセージボディ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
リクエストライン GET /test.html HTTP/1.1 Host: www.example.ac.jp GET /test.html HTTP/1.1 HTTPメソッド HTTPのバージョン URIのパスとクエリ
Hostヘッダ GET /test.html HTTP/1.1 Host: www.example.ac.jp Host: www.example.ac.jp ホスト 名 (:ポート 番 号 ) http://www.example.ac.jp/test.html
名 前 ベースのバーチャルホスト http://www.ouj.ac.jp/ www.ouj.ac.jp 172.19.0.1 www.example.ac.jp 192.168.18.3 test.example.ac.jp 192.168.18.5
名 前 ベースのバーチャルホスト http://www.example.ac.jp/ www.ouj.ac.jp 172.19.0.1 www.example.ac.jp 192.168.18.3 test.example.ac.jp 192.168.18.5
名 前 ベースのバーチャルホスト http://test.example.ac.jp/ www.ouj.ac.jp 172.19.0.1 www.example.ac.jp 192.168.18.3 test.example.ac.jp 192.168.18.5
名 前 ベースのバーチャルホスト http://www.ouj.ac.jp/ http://www.example.ac.jp/ http://test.example.ac.jp/ www.ouj.ac.jp www.example.ac.jp test.example.ac.jp 172.19.0.1 Host: www.example.ac.jp
ステータスライン HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
ステータスライン HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 ) HTTPのバージョン HTTP/1.1 200 OK ステータスコード ステータスコードの 説 明
ステータスコード ステータ スコード 説 明 意 味 200 OK リクエストに 成 功 した 404 Not Found リソースが 存 在 しない 403 Forbidden 権 限 がない 500 Internal Server Error サーバ 側 でエラーが 起 こった
レスポンスメッセージのヘッダ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
レスポンスメッセージのヘッダ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> ヘッダ 意 味 <html lang="ja"> Date ( 以 下 略 ) メッセージが 作 成 された 日 時
レスポンスメッセージのヘッダ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> ヘッダ 意 味 <html lang="ja"> Date ( 以 下 略 ) メッセージが 作 成 された 日 時 Content-Length 送 り 返 すリソースのサイズ (バイト)
レスポンスメッセージのヘッダ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> ヘッダ 意 味 <html lang="ja"> Date ( 以 下 略 ) メッセージが 作 成 された 日 時 Content-Length 送 り 返 すリソースのサイズ (バイト) Content-Type 送 り 返 すリソースのメディアタイプ
レスポンスメッセージのヘッダ HTTP/1.1 200 OK Date: Tue, 01 Oct 2013 09:17:32 GMT Content-Length: 244 Content-Type: text/html; charset=utf-8 <!DOCTYPE html> <html lang="ja"> ( 以 下 略 )
HTTPメッセージの 実 例 <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="./style.css" type="text/css"> <title> 放 送 太 郎 の 自 己 紹 介 </title> </head> <body> <h1> 放 送 太 郎 の 自 己 紹 介 </h1> <h2> 略 歴 </h2> <p> 神 奈 川 県 横 浜 市 出 身 1983 年 生 まれの29 歳 です 大 学 では 英 文 学 を 学 びました 現 在 は 千 葉 県 の<a href="http://www.ouj.ac.jp/"> 放 送 大 学 </a> 本 部 で 勤 務 しています <img src="./ouj.jpg" alt=" 放 送 大 学 本 部 を 正 門 側 から 撮 った 写 真 右 の 建 物 の 屋 上 に 電 波 塔 が 見 える "> </p> <h2> 趣 味 </h2> <ul> <li> 読 書 </li> <li>オートバイ</li> <li>プラモデル 製 作 </li> </ul> <address> 連 絡 先 : <a href="mailto:taro@example.com">taro@example.com</a></address> </body> </html>
HTTPメッセージの 実 例 http://www.example.ac.jp/taro.html
HTTPメッセージの 実 例
1 回 目 のHTTPリクエスト レスポンス GET /taro.html HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Thu, 12 Jun 2014 01:58:09 GMT Etag: "37c-4fb99e47fee40" Accept-Ranges: bytes Content-Length: 892 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 レスポンス
取 得 したHTML 文 書 <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="./style.css" type="text/css"> <title> 放 送 太 郎 の 自 己 紹 介 </title> </head> <body> <h1> 放 送 太 郎 の 自 己 紹 介 </h1> <h2> 略 歴 </h2> <p> 神 奈 川 県 横 浜 市 出 身 1983 年 生 まれの29 歳 です 大 学 では 英 文 学 を 学 びました 現 在 は 千 葉 県 の<a href="http://www.ouj.ac.jp/"> 放 送 大 学 </a> 本 部 で 勤 務 しています <img src="./ouj.jpg" alt=" 放 送 大 学 本 部 を 正 門 側 から 撮 った 写 真 右 の 建 物 の 屋 上 に 電 波 塔 が 見 える "> </p> <h2> 趣 味 </h2> <ul> <li> 読 書 </li> <li>オートバイ</li> <li>プラモデル 製 作 </li> </ul> <address> 連 絡 先 : <a href="mailto:taro@example.com">taro@example.com</a></address> </body> </html>
2 回 目 のHTTPリクエスト レスポンス GET /style.css HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/css,*/*;q=0.1 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Mon, 02 Jun 2014 07:37:14 GMT Etag: "86-4fad576be3e80" Accept-Ranges: bytes Content-Length: 134 Keep-Alive: timeout=5, max=99 Connection: Keep-Alive Content-Type: text/css レスポンス
3 回 目 のHTTPリクエスト レスポンス GET /ouj.jpg HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Tue, 10 Jun 2014 02:08:27 GMT Etag: "9fca-4fb71cda71cc0" Accept-Ranges: bytes Content-Length: 40906 Keep-Alive: timeout=5, max=98 Connection: Keep-Alive Content-Type: image/jpeg レスポンス
1 回 目 のHTTPリクエスト レスポンス GET /taro.html HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 3 HTTPメソッド Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト 1 持 続 的 接 続 HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Thu, 12 Jun 2014 01:58:09 GMT 4 ステータスコード Etag: "37c-4fb99e47fee40" Accept-Ranges: bytes Content-Length: 892 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 2 メッセージボディのサイズ 1 持 続 的 接 続 レスポンス
持 続 的 接 続 クライアント サーバ クライアント サーバ 持 続 的 接 続 な し 持 続 的 接 続 あ り
1 回 目 のHTTPリクエスト レスポンス GET /taro.html HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Thu, 12 Jun 2014 01:58:09 GMT Etag: "37c-4fb99e47fee40" Accept-Ranges: bytes Content-Length: 892 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 レスポンス
1 回 目 のHTTPリクエスト レスポンス GET /taro.html HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Thu, 12 Jun 2014 01:58:09 GMT Etag: "37c-4fb99e47fee40" Accept-Ranges: bytes Content-Length: 892 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 Connection: keep-alive Connection: close レスポンス
1 回 目 のHTTPリクエスト レスポンス GET /taro.html HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Thu, 12 Jun 2014 01:58:09 GMT Etag: "37c-4fb99e47fee40" Accept-Ranges: bytes Content-Length: 892 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 2 メッセージボディのサイズ レスポンス
レスポンス メッセージボディのサイズ HTTP/1.1 200 OK Content-Length: 892 Content-Type: text/html; charset=utf-8 リクエスト POST /test HTTP/1.1 Host: www.example.ac.jp Content-Type: application/x-www-form-urlencoded Content-Length: 19 qt=%e3%81%82&page=1
チャンク 転 送 The Open University of Japan was founded in 1983. HTTP/1.1 200 OK Content-Type: text/plain Content-Length: 49 レスポンス The Open University of Japan was founded in 1983.
チャンク 転 送 The Open University of Japan was founded in 1983. HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/plain レスポンス 13 The Open University d of Japan was 11 founded in 1983. 0
チャンク 転 送 The Open University of Japan was founded in 1983. HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/plain レスポンス 13 The Open University d of Japan was 11 founded in 1983. 0
チャンク 転 送 The Open University of Japan was founded in 1983. HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/plain チャンクサイズ ( 十 六 進 数 ) レスポンス 13 The Open University d of Japan was 11 founded in 1983. 0 チャンクデータ
チャンク 転 送 The Open University of Japan was founded in 1983. HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/plain レスポンス 13 The Open University d of Japan was 11 founded in 1983. 0
チャンク 転 送 The Open University of Japan was founded in 1983. HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/plain レスポンス 13 The Open University d of Japan was 11 founded in 1983. 0
チャンク 転 送 The Open University of Japan was founded in 1983. HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/plain レスポンス 13 The Open University d of Japan was 11 founded in 1983. 0
1 回 目 のHTTPリクエスト レスポンス GET /taro.html HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 3 HTTPメソッド Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Thu, 12 Jun 2014 01:58:09 GMT Etag: "37c-4fb99e47fee40" Accept-Ranges: bytes Content-Length: 892 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 レスポンス
HTTPメソッド GET POST DELETE OPTIONS HEAD PUT CONNECT TRACE
GET リソースの 取 得 HTTPメソッド アドレスバーにURIを 入 力 ハイパーリンクをクリック POST 多 目 的 PUT リソースの 作 成 更 新 DELETE リソースの 削 除
POSTメソッド メッセージボディを 持 った リクエストを 送 信
1 回 目 のHTTPリクエスト レスポンス GET /taro.html HTTP/1.1 Host: www.example.ac.jp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: ja,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive リクエスト HTTP/1.1 200 OK Date: Thu, 12 Jun 2014 10:26:23 GMT Server: Apache Last-Modified: Thu, 12 Jun 2014 01:58:09 GMT 4 ステータスコード Etag: "37c-4fb99e47fee40" Accept-Ranges: bytes Content-Length: 892 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 レスポンス
ステータスコード 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported
ステータスコードの 分 類 先 頭 の 数 字 意 味 説 明 1xx 2xx 3xx 4xx 5xx 情 報 提 供 (Informational) 成 功 (Successful) リダイレクト (Redirection) クライアントエラー (Client Error) サーバエラー (Server Error) リクエストは 受 け 付 けられて 処 理 を 継 続 中 である リクエストは 成 功 した リクエストを 完 了 するためには さらなる 動 作 が 必 要 である リクエストの 方 法 を 間 違 えてい るか 受 け 入 れられない サーバ 側 で 処 理 に 失 敗 した
ステータスコード 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported
ステータスコードの 分 類 先 頭 の 数 字 意 味 説 明 1xx 2xx 3xx 4xx 5xx 情 報 提 供 (Informational) 成 功 (Successful) リダイレクト (Redirection) クライアントエラー (Client Error) サーバエラー (Server Error) リクエストは 受 け 付 けられて 処 理 を 継 続 中 である リクエストは 成 功 した リクエストを 完 了 するためには さらなる 動 作 が 必 要 である リクエストの 方 法 を 間 違 えてい るか 受 け 入 れられない サーバ 側 で 処 理 に 失 敗 した
ステータスコード 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported
ステータスコード 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported
ステータスコード404 レスポンス HTTP/1.1 404 Not Found Content-Length: 206 Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>not Found</h1> <p>the requested URL /notfound was not found on this server.</p> </body></html>
ステータスコード404 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>not Found</h1> <p>the requested URL /notfound was not found on this server.</p> </body></html>
ステータスコードの 分 類 先 頭 の 数 字 意 味 説 明 1xx 2xx 3xx 4xx 5xx 情 報 提 供 (Informational) 成 功 (Successful) リダイレクト (Redirection) クライアントエラー (Client Error) サーバエラー (Server Error) リクエストは 受 け 付 けられて 処 理 を 継 続 中 である リクエストは 成 功 した リクエストを 完 了 するためには さらなる 動 作 が 必 要 である リクエストの 方 法 を 間 違 えてい るか 受 け 入 れられない サーバ 側 で 処 理 に 失 敗 した
ステータスコード 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported
ステータスコード301 リソースが 恒 久 的 に 移 動 した Locationヘッダの 値 に 移 動 先 のURI
ステータスコード301 http://www.example.ac.jp/oldpath http://www.example.ac.jp/newpath GET /oldpath HTTP/1.1 Host: www.example.ac.jp HTTP/1.1 301 Moved Permanently Location: http://www.example.ac.jp/newpath Content-Length: 240 Content-Type: text/html; charset=iso-8859-1 リクエスト レスポンス <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>moved Permanently</h1> <p>the document has moved <a href="http://www.example.ac.jp/newpath">here</a>.</p> </body></html>
ステータスコード301
ステータスコードの 分 類 先 頭 の 数 字 意 味 説 明 1xx 2xx 3xx 4xx 5xx 情 報 提 供 (Informational) 成 功 (Successful) リダイレクト (Redirection) クライアントエラー (Client Error) サーバエラー (Server Error) リクエストは 受 け 付 けられて 処 理 を 継 続 中 である リクエストは 成 功 した リクエストを 完 了 するためには さらなる 動 作 が 必 要 である リクエストの 方 法 を 間 違 えてい るか 受 け 入 れられない サーバ 側 で 処 理 に 失 敗 した
ステータスコード 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported
ステータスコード 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported
ステータスコード503 GET / HTTP/1.1 Host: www.example.ac.jp リクエスト HTTP/1.1 503 Service Unavailable Date: Sun, 15 Jun 2014 06:20:53 GMT Content-Length: 299 Retry-After: Sun, 15 Jun 2014 09:59:59 GMT Content-Type: text/html; charset=iso-8859-1 レスポンス <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>503 Service Unavailable</title> ( 以 下 略 )
ステータスコード503
ステータスコード503 GET / HTTP/1.1 Host: www.example.ac.jp リクエスト HTTP/1.1 503 Service Unavailable Date: Sun, 15 Jun 2014 06:20:53 GMT Content-Length: 299 Retry-After: Sun, 15 Jun 2014 09:59:59 GMT Content-Type: text/html; charset=iso-8859-1 レスポンス <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>503 Service Unavailable</title> ( 以 下 略 )
リクエスト GET /taro.html HTTP/1.1 Host: www.example.ac.jp レスポンス メディアタイプ HTTP/1.1 200 OK Content-Length: 892 Content-Type: text/html; charset=utf-8
リクエスト GET /taro.html HTTP/1.1 Host: www.example.ac.jp レスポンス メディアタイプ HTTP/1.1 200 OK Content-Length: 892 Content-Type: text/plain; charset=utf-8
第 5 回 の 内 容 HTTPの 規 格 HTTPメッセージの 基 本 メッセージの 構 造 持 続 的 接 続 メッセージボディのサイズとチャンク 転 送 HTTPメソッド ステータスコード