- Gets information from a path (“index.html”) or URI (“http://www.google.com”)
- Octothorpe (#) indicates that this is an instance method
- initheader defaults to an empty hash
- supports three levels of compression (gzip, deflate, identity)
- This routine also does decompression
HTTP stands for hypertext transfer protocol, and is the language of servers communicating.
Sockets are endpoints of a bidirectional communication channel. Sockets can communicate within a process, between processes on the same machine or between different machines.
Another term for the pound sign (#). Called an octothorpe because it has eight points. The pound sign is sometimes called a “hash”, but in Ruby, a Hash is a way of storing things in a key value pair.
HTTP is called a stateless protocol because each command is executed independently, without any knowledge of the commands that came before it. This is the main reason that it is difficult to implement Web sites that react intelligently to user input. This shortcoming of HTTP is being addressed in a number of new technologies, including ActiveX, Java, JavaScript and cookies.
The most common URI is URL, uniform resource locator.
response = http.request_head('/index.html') p response['content-type']