An Introduction to the HTTP protocol
by K. Yue, copyright 2000
Revised: September 17, 2000

HTTP connection

Client Requests

Examples:

GET /cgi-bin/formex1?name=Bun+Yue&topic=fish
User-Agent: Mozilla/1.1N (X11; I; IRIX 5.3 IP22)
Accept text/plain
Accept application/html
...
Accept */*
 

Note that there is a blank line after the last accept field.

POST /cgi-bin/formex2
User-Agent: Mozilla/1.1N (X11; I; IRIX 5.3 IP22)
Accept text/plain
Accept application/html
...
Accept */*

name=Bun+Yue&topic=fish

Server Responses

Example:

HTTP/1.0 200 OK
Date: Fri, 04 Oct 1996 18:05:04 GMT
Server: NCSA/1.4.2
MIME-version: 1.0
Content-type: text/html
Last-modified: Tue, 01 Oct, 1996 12:02:03 GMT
Content-Length: 3109

<HTML>
<HEAD>
<TITLE> Dr. Kwok-Bun Yue Home Page </TITLE>
...

HTTP Status Code

Code Meaning
400 Wrong request syntax.
401 Authorization required. A list of allowed authorization scheme will also be sent.
402 No Chargeto field on the request for a paid service.
403 Forbidden resource
404 The server cannot find the URL requested.
405 Accessing the resource using a method not allowed.
406 Resource type incompatible with the client.
410 Resource no longer available and no forwarding information exist.
500 The server has encountered an internal error and cannot continue with the request.
501 The server does not support the method of a legal request.
502 Secondary server does not return a valid response.
503 The service is unavailable, because the server is too busy.
504 Secondary server takes too long to respond.