2017년 2월 2일 목요일

Hypertext Transfer Protocol (HTTP)

1. Web Protocols
: many protocols in use on the Web, but only two are Web protocols
 - Hypertext Transfer Protocol
 - Simple Object Access Protocol

2. HTTP (Hypertext Transfer Protocol) /1.1
 : Client and server exchange request/response messages
 1) Messages: <message> ::= (<request>|<response>)
                                      <header>*
                                       CRLF
                                      <body>

 2) Methods
  - GET: request a representation of a resource
  - HEAD: request the body-less response from a GET method
  - POST: request that a representation be accepted as a new subordinate of the specified resource
  - PUT: uploads a representation of the specified resource
  - DELETE: deletes the specified resource

 3) Request Headers
  - Accept: specify desired media type of response
  - Accept-Language: specify the desired language of response
  - Date
  - Host: host and port number of requested resource
  - If-Match
  - Referer
  - User-Agent

 4) Status Codes
  - 1xx: informational message
  - 2xx: success
   e.g. 200 OK, 201 Created
  - 3xx: redirection
   e.g. 300 Multiple Choices, 301 Moved Permanently, 302 Found
  - 4xx: client error
   e.g. 401 Unauthorized, 403 Forbidden, 404 Not Found, 405 Method Not Allowed
  - 5xx: server error

 5) Response Headers
  - Allow
  - Content-Language
  - Content-type
  - Content-Length
  - Date
  - Expires: date/time after which response is considered stale
  - ETag
  - Last-Modified: date/time at which representation was last changed

 6) HTTP Content Negotiation
 : HTTP allows the serving of different representations of a resource based on client preferences

https://www.w3.org/Protocols/rfc2616/rfc2616.html

2. HTTP Extensions
 1) WebDAV: HTTP/1.1 is still essentially a read-only protocol, as deployed
  => Web Distributed Authoring and Versioning - HTTP Extensions

https://www.w3.org/Protocols/HTTP/ietf-http-ext/

3. Beyond HTTP/1.1
 1) HTTP Limitations: Before HTTP/1.1, each HTTP request used a separate TCP connections
  => In order to fetch multiple resources from a server, HTTP/1.0 opens multiple connections to that server
  => increase latency if connections are not concurrent
  => two partial solutions in HTTP/1.1 : HTTP Keep-Alive, HTTP Pipelining

 2) HTTP Keep-Alive: TCP connections reuse for multiple HTTP requests
 3) HTTP pipelining: Pipelining allows multiple requests to be made without waiting for response
 4) SPDY: purely a framing layer
  - Offers four improvements over HTTP/1.1: Multiplexed requests, Prioritised requests, Compressed headers and Server Push
 5) HTTP/2.0 Prioritised Requests: Each stream has another 31-bit integer that expresses its relative priority
 6) HTTP/2.0 Compressed Headers
 7) HTTP/2.0 Push: HTTP/2.0 enables a server to pre-emptively send (or push) multiple associated resources to a client in response to a single request

https://http2.github.io/

댓글 없음:

댓글 쓰기