Herong's Tutorial Notes on Web Service and SOAP
Dr. Herong Yang, Version 4.00

Examples of HTTP 1.0 Requests and Responses

This section provides some tutorial examples of HTTP 1.0 requests and responses. Google and Wikipedia are still supporting HTTP 1.0 protocols.

Let's continue to try my Perl socket test program to send a simple HTTP 1.0 request to some other Web servers.

www.wikipedia.org likes my HTTP 1.0 request and I received a good HTTP 1.0 response:

\herong>SocketRequestResponse.pl www.wikipedia.org 80 http_get.req
   http_get.res

\herong>type http_get.res
HTTP/1.0 200 OK
Date: ... 2009
Server: Apache
Cache-Control: s-maxage=3600, must-revalidate, max-age=0
Last-Modified: Tue, 21 Jul 2009 23:54:41 GMT
Vary: Accept-Encoding
Content-Length: 6091
Content-Type: text/html; charset=utf-8
X-Cache: HIT from sq39.wikimedia.org
X-Cache-Lookup: HIT from sq39.wikimedia.org:3128
Age: 195
X-Cache: HIT from eiximenis.wikimedia.org
X-Cache-Lookup: HIT from eiximenis.wikimedia.org:80
Connection: close

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://w...
<!-- Sysops: Please do not edit the main template directly; update...
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-...
  <meta http-equiv="Content-Language" content="en" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
...

www.apache.org accepted my HTTP 1.0 request. But it delivered a good HTTP 1.1 response back to me:

\herong>SocketRequestResponse.pl www.apache.org 80 http_get.req
   http_get.res

\herong>type http_get.res
HTTP/1.1 200 OK
Date: ... 2009
Server: Apache/2.3.4 (Unix) mod_ssl/2.3.4 OpenSSL/0.9.7d mod_fcgid...
Last-Modified: Wed, 23 Dec 2009 14:11:41 GMT
ETag: "cb717d-6bcc-47b65e6cdc140"
Accept-Ranges: bytes
Content-Length: 27596
Cache-Control: max-age=86400
Expires: ... 2009
Vary: Accept-Encoding
Connection: close
Content-Type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  ...
-->
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
...

My HTTP 1.0 worked nicely on www.google.com:

\herong>SocketRequestResponse.pl www.google.com 80 http_get.req
   http_get.res

\herong>type http_get.res
HTTP/1.0 200 OK
Date: ... 2009
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=36f1760e936ac4ea:TM=1262399916:LM=1262399916:S...
Set-Cookie: NID=30=s9IcPpepJ8gkHjNmrV2IpOLgLfkus6sGG6F8TYxx7sNx5tX...
Server: gws
X-XSS-Protection: 0

<!doctype html><html><head><meta http-equiv="content-type" content...
window.google.sn="webhp";window.google.timers={load:{t:{start:(new...
var _gjwl=location;function _gjuc(){var e=_gjwl.href.indexOf("#");...
window._gjuc())&&setTimeout(_gjp,500)};
window._gjp && _gjp()</script><style>td{line-height:.8em;}.gac_m t...
;google.y.first.push(function(){google.ac.m=1;google.ac.b=true;goo...
function a(){google.timers.load.t.ol=(new Date).getTime();google.r...
})();
</script>

Last update: 2009.

Sections in This Chapter

SocketRequestResponse.pl - Socket Level Testing Program

Examples of HTTP 1.0 Requests and Responses

Examples of HTTP 1.1 Requests and Responses

SOAP 1.1 Request - Content-Length Too Small

SOAP 1.1 Request - Content-Length Too Large

SOAP 1.1 Request and Response of GetSpeech

SOAP 1.2 Request and Response of GetSpeech

Dr. Herong Yang, updated in 2009
Examples of HTTP 1.0 Requests and Responses