Multimedia Information Systems VO/KU (706.052/706.053)

HTTP and URLs

Denis Helic

IICM, TU Graz

Server-side Technologies: Historical Background (1)

Server-side Technologies: Historical Background (2)

Server-side Technologies: Historical Background (3)

Server-side Technologies: Today

HTTP (1)

HTTP (2)

HTTP (3)

HTTP Request Message

HTTP Request Methods (1)

HTTP Request Methods (2)

HTTP Request Methods (3)

HTTP Safe Methods

HTTP Idempotent Methods

HTTP Headers

Headers

HTTP Response (1)

HTTP Response (2)

Status Codes

HTTP Request/Response: Example (1)

telnet coronet.iicm.edu 80
Trying 129.27.200.61...
Connected to coronet.iicm.edu (129.27.200.61).
Escape character is '^]'.
GET / HTTP/1.1
Host: coronet.iicm.tugraz.at

HTTP Request/Response: Example (2)

HTTP/1.1 200 OK
ETag: W/"413-1160316312000"
Last-Modified: Sun, 08 Oct 2006 14:05:12 GMT
Content-Type: text/html
Content-Length: 413
Date: Mon, 12 Nov 2007 11:08:09 GMT
Server: Apache-Coyote/1.1

<html>
...

HTTP Request/Response: Example (3)

curl -x proxy.iicm.edu:3128 http://coronet.iicm.tugraz.at 
	-i -X TRACE

HTTP/1.0 200 OK
Content-Type: message/http
Content-Length: 322
Date: Mon, 12 Nov 2007 11:10:37 GMT
Server: Apache-Coyote/1.1
X-Cache: MISS from gk01.iicm.tugraz.at
X-Cache-Lookup: NONE from gk01.iicm.tugraz.at:3128
Proxy-Connection: keep-alive

HTTP Request/Response: Example (4)

TRACE / HTTP/1.0
user-agent: curl/7.16.4 (i486-pc-linux-gnu) libcurl/7.16.4 OpenSSL/0.9.8e zlib/1.2.3.3 libidn/1.0
host: coronet.iicm.tugraz.at
pragma: no-cache
accept: */*
via: 1.1 gk01.iicm.tugraz.at:3128 (squid/2.5.STABLE14)
x-forwarded-for: 129.27.153.250
cache-control: max-age=259200
connection: keep-alive

HTTP Request/Response: Example (5)

curl -x proxy.iicm.edu:3128 http://coronet.iicm.tugraz.at 
	-i -X OPTIONS
HTTP/1.0 200 OK
Allow: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS
Content-Length: 0
Date: Mon, 12 Nov 2007 11:12:26 GMT
Server: Apache-Coyote/1.1
X-Cache: MISS from gk01.iicm.tugraz.at
X-Cache-Lookup: MISS from gk01.iicm.tugraz.at:3128
Proxy-Connection: keep-alive

URLs (1)

URLs (2)

URLs (3)

Communication between Web server and external programs

Common Gateway Interface (CGI)

CGI Specification (1)

CGI Specification (2)

CGI Specification (3)

CGI Specification (4)

CGI Specification (5)

CGI Examples (1)

CGI Examples (2)

#!/bin/sh
# send http-header and a newline afterwards:
echo "Content-Type: text/html"
echo ""

CGI Examples (3)

# send html content:
echo "<HTML>"
echo "  <HEAD>"
echo "    <TITLE>Hello World CGI</TITLE>"
echo "  </HEAD>"
echo "  <BODY>"
echo "  Hello World ("
date "+%T, %d.%m.%Y"
echo ")"
echo "  </BODY>"
echo "</HTML>"

CGI Examples (4)

CGI Examples (5)

#!/usr/bin/perl

require "cgi-lib.pl";

print &PrintHeader;
print "<hr>";
print &PrintEnv;

CGI Examples (6)

CGI Examples (7)

CGI Examples (8)

CGI Examples (9)

#!/usr/bin/perl

require "cgi-lib.pl";

if (&ReadParse) {
   print &PrintHeader, &PrintVariables;
} else {
  print &PrintHeader,'<form><input type="submit">
   Data: <input name="myfield">';
}

CGI Applications (1)

CGI Applications (2)

CGI Security (1)

if($email =~ /[^a-zA-Z0-9_\-\.@]/){
  $_ = "The email address should be of 
   the form <i>user\@server</i>!";
}else{
  $_ = qx($finger $email);
}

CGI Security (2)