2013년 12월 4일 수요일

HTTP Header structure - Request

This is what happens when you open your browser and navigate to www.test.com.
An HTTP request to www.test.com is initiated.



What you see here are the Headers, called HTTP Request Headers for this request.
Note that a connection to the test.com port 80 or 443 is initiated before sending HTTP/HTTPS commands to the webserver.


===============================
GET / HTTP/1.1
Host: www.test.com
Proxy-Connection: keep-alive
Accept: text/html
User-Agent: Chrome/31.0.1650.57
Accept-Encoding: sdch
Accept-Language: ko-KR,ko
Connection: Keep-alive
===============================


GET / HTTP/1.1
Hostwww.test.com
Accept: text/html
User-Agent: Chrome/31.0.1650.57
Connection: Keep-alive



: Request method. This the type of your request. Get is the request type when you type a website URL in your location bar and hit enter. Other value POST, HEAD and etc.

: Path. This is the file you're requesting. The home page of a website is always "/".
Other pages can be requested such as : "/user/image/banner.jpg"
You always refer to the root folder to specify the requested file.

: Protocol. This is the HTTP protocol version your browser is talking. This basically hints the web server which language will be used in the communication.

: Host header. This is the beginning of HTTP Request Headers. HTTP Headers have the following structure : Header name:Header Value
The Host header allows a web server to host multiple websites on the same IP address.
This means that you will have to specify which website you're interested in, in the Host header.

: Host value. After each Request header you find it's corresponding value. in this case you want to reach the host "www.test.com"

: Accept header. This header is used by the browser to specify which document type is expected as the result of this request.

: The user agent reveals the browser version, operating system and language to the remote web server. All web browsers have their own identification user agent. This is how most web site recognize the type of browser in use.

: Header connection. With HTTP 1.1 you can keep your connection to the remote web server open for a given time using the value "Keep-alive". All the requests to the web server will go through this connection without reinstating a new connection every time(always HTTP 1.0).

댓글 없음:

댓글 쓰기