Overview

  • HTTP
    • A protocol for distributed, collaborative, hypermedia information systems.
    • A request/response standard typical of client-server computing.
    • Currently dominant version is HTTP/1.1.
  • Massively used to deliver content over the Web
    • Web browsers and spiders are relying on HTTP.
  • The protocol is not constrained to TPC/IP
    • It only presumes a reliable transport.
  • Resources accessed by HTTP are identified by URIs (more specifically URLs), using the http URI schemes. 


HTTP Request-response format

  • Request consists of
    • Request line, such as GET /images/logo.gif HTTP/1.1, which requests are source called /images/logo.gif from server.
    • Headers, such as Accept-Language: en
    • An empty line
    • An optional message body
  • Response consists of
    • Status line which includes numeric status code and textual reason phrase
    • Response headers
    • An empty line
    • The requested content


HTTP Request methods

 
  • HTTP request methods indicate the desired action to be performed on the identified resource:           
    • GET
      • Requests a representation of the specified resource. GET should not be used for operations that cause side-effects (problematic with robots and crawlers). Those operations are called safe operations.
    • POST
      • Submits data to be processed (e.g., from an HTML form) to the identified resource. The data is included in the body of the request.
    • PUT
      • Uploads a representation of the specified resource.
    • DELETE
      • Deletes the specified resource.


HTTP Example – Retrieving FOAF profile

  • Example is relying on curl which is a command line tool used to transfer data with URL syntax
    • Supports many protocols such as FTP, FTPS, HTTP, HTTPS, SCP, SFTP, etc.
    • More information can be found at http://curl.haxx.se
  • curl usage pattern is simple:

    $ curl -v http://www.google.at
    * About to connect() to www.google.at port 80 (#0)
    * Trying 74.125.87.104... connected
    * Connected to www.google.at (74.125.87.104) port 80 (#0)
    > GET / HTTP/1.1
    > User-Agent: curl/7.19.6 (i686-pc-cygwin) libcurl/7.19.6 OpenSSL/0.9.8o zlib/1.2.3 libidn/1.18 libssh2/1.2
    > Host: www.google.at
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Date: Sun, 13 Jun 2010 15:13:15 GMT
    < Expires: -1
    < Cache-Control: private, max-age=0
    < Content-Type: text/html; charset=ISO-8859-1
    < Set-Cookie: PREF=ID=29937d127162f98f:TM=1276441995:LM=1276441995:S=wQcvUApkDnuGPQEa; expires=Tue, 12-Jun-2012 15:13:15
    < Server: gws
    < X-XSS-Protection: 1; mode=block
    < Transfer-Encoding: chunked
    <



HTTP Example – Retrieving FOAF profile

Srdjans-MacBook-Pro:~ skomazec$ curl -v http://www.sti-innsbruck.at/fileadmin/scripts/foaf.php?id=215

* About to connect() to www.sti-innsbruck.at port 80 (#0)

* Trying 138.232.65.141... connected* Connected to www.sti-innsbruck.at (138.232.65.141) port 80 (#0)

> GET /fileadmin/scripts/foaf.php?id=215 HTTP/1.1

> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3

> Host: www.sti-innsbruck.at

> Accept: */*

< HTTP/1.1 200 OK

< Date: Sun, 06 Jun 2010 15:55:57 GMT

< Server: Apache

< X-Powered-By: PHP/5.2.0-8+etch16

< Content-Length: 944

< Content-Type: text/html; charset=UTF-8

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

xmlns:foaf="http://xmlns.com/foaf/0.1/">

Srdjan Komazec

Srdjan

Komazec

7348d8f19c568de04c7718880f700fad7acdfab9

* Connection #0 to host www.sti-innsbruck.at left intact

* Closing connection #0

Requested resource





Creator: sidraaslam

Contributors:
-


Licensed under the Creative Commons
Attribution ShareAlike CC-BY-SA license


This deck was created using SlideWiki.