02152  Concurrent Systems - NP Lab 2: A simple HTTP client
Technical University of Denmark DTU
02152 Concurrent Systems        Fall 2008
NP Lab 2: A simple HTTP client
Home Plan Material  

Purpose

This lab should give you a basic experience with the use of application layer protocols.

Time and Place

Assistance for this programming lab will be available in the G-databar, Building 308, Rooms 15 + 16, Thursday, November 6, 15.00-17.00.

Preparations

This describes the second set of practical exercises for the Network Programming part of the course in Concurrent Systems. The exercises assume that you have read at least Sections 1 to 9 of ``The Poor Man's Guide to Computer Networks and their Applications'' [PMG].

An HTTP Client

Develop a simple HTTP client following the general instructions for constructing client code given in [PMG 9]. The client should offer the user facilities for connecting to an HTTP server, sending it one or more HTTP commands provided by the user, and receiving (and displaying) the responses. The syntax for HTTP commands and responses can be found in [PMG 8].

Note that you are expected just to produce a client, not an entire Web browser application which can interpret the contents of the resources fetched from the server.

To do this exercise, you will in particular need to look at the documentation for the Java class java.net.Socket. You may also find it helpful to look at java.net.URI, which contains a number of methods for parsing URIs and separating them into their components.

You should test your program against a convenient server, preferably here at DTU.

[Originally by Robin Sharp, 2002-2003. Modified by Hans Henrik Løvengreen 2004-2008.]
Hans Henrik Løvengreen, Nov 3, 2008