Sunday, February 12, 2012

HTTP and more

HTTP:
connectionless and stationless
each request requires its own connection.
it has no memory of prior connections.

GET method. containing no body content, a GET request is comprised of only a method statement and various request header fields
GET /login.html HTTP/1.1
User-Agent ...
Even though a GET request does not send any information in the body of the message, data can still be pased as part of the GET statement itself
GET /login.html?username=dustin&...
GET method is normally used to request static data.
conditional GET: if a GET request includes and IF-Modified-Since
http servers tranditionally store GET parameters in system environment variables that can be accessed by CGI programs.

POST Method
is commonly used for passing user input to the server. all the info is stored in the body of the request rather than in the URL portion of the method statement.
advantages: info is not visible in the URL and there is no limit to the amount of information that can be passed.
POST /login.html http:/1.1
more header info

(in the body) username=dustin&...

basic authentication:
GET /salary.html HTTP/1.0
Authorization: Basic TATATATTTT (BASE64 encoding of the username and password)

MIME
Multipurpose Internet Mail Extensions

No comments:

Post a Comment