Skip to content

Instantly share code, notes, and snippets.

@stephaniewilkinson
Last active August 29, 2015 14:03
Show Gist options
  • Save stephaniewilkinson/0a62efb9bda07f6e3be4 to your computer and use it in GitHub Desktop.
Save stephaniewilkinson/0a62efb9bda07f6e3be4 to your computer and use it in GitHub Desktop.
What's the HTTP Get method?

What's the HTTP Get method?

  • 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

What's HTTP?

HTTP stands for hypertext transfer protocol, and is the language of servers communicating.

What's a socket?

Sockets are endpoints of a bidirectional communication channel. Sockets can communicate within a process, between processes on the same machine or between different machines.

What's an octothorpe?

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.

What's a Hash?

Can HTTP remember requests?

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.

What's a URI?

The most common URI is URL, uniform resource locator.

response = http.request_head('/index.html') p response['content-type']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment