http protocol response-request clients not limited to web browsers. anything that can access code...
TRANSCRIPT
http protocol
• Response-request• Clients not limited to web browsers. Anything that
can access code implementing the protocol works:– Standalone programs in
• Java• Perl• C, C++• Javascript• PHP• Lisp• …
http protocol
• Requests:– GET– POST– HEAD
• GET originally designed for request to provide a resource (the part after the http://<hostname>/
• Extended with CGI query syntax
GET vs Post: CGI Query Sytax
• GET– uses CGI http://…../db?arg1=val1&arg2=val2&…– Issues:
• data is exposed• only good for small data
• POST– Arbitrary data can be sent to server including
• plain text• serialized objects• …
http Responses
• Headers can include data about– Content Format
• MIME Content types
• text/html
• text/xml
• application/msword
• application/jpeg
• application/gif
• application/mpeg
• …
http Responses
• Headers can include data about– Content Format – Cache control (e.g. how long cache will be
valid)– Length of message– Last Modification Date
Server side programming
• In the old days (circa 1993-1998) most server side programming was perl using the cgi interface libraries, processing GET
• Generalizations in Java:– Servlets. Classes wrap most of the protocol. servlet
implements doGet and doPut– JSP (client side) builds servlets on-the-fly.– Need to be embedded in a web container implementing
the servlet API, e.g. Apache jakarta tomcat, JServ (somewhat obsolete), and commercial products
Tomcat
• Web container• Embeddable in web servers such as Apache• Can run standalone (which is what we'll
do). In other words, it also can do http protocols.
• In fact when embedded in a webserver, the server forwards the http requests and responses. (Part of web container spec?)