CS-2910 Network Protocols

Dr. Mark Sebern -- Fall quarter 2014-2015

Lab 3: Simple Python HTTP client

Revised: 24 September 2014

Lab assignment

This is a team assignment; each team should be two members unless a different size is approved by the instructor.


The goal of this lab is to write a short Python program, to request and save a web resource, acting as an HTTP client.

The program has at least the following functions; you may add others.

The provided main function will perform basic tests. you may add others. no user input is needed.
Using HTTP, request a web resource and store the returned data in the specified file.


  1. Download the skeleton Python template: cs2910-lab-httpclient-template-py.txt
  2. Rename the template file to cs2910-lab03-username1-username2{-username3}.py, where each "usernameN" is the MSOE email username (e.g., "smithj") of a team member, in alphabetical order.
  3. Edit the header of the file to include your team members' names.
  4. Complete the method to request, receive, and store the designated resource. You may add other helper methods, but do not change the code provided in the template.
  5. Add comments at the end of your Python file, with the following information:
    • A description of the functionality you implemented and the results of your testing.
    • Comments on your experience in completing the lab, including any problems you encountered. Briefly explain what you learned.
    • Questions and suggestions.

You may not use a prebuilt library like httplib; the point of this lab is for you to understand the low-level implementation of the HTTP protocol.

Additional implementation details will be discussed in class. If you have questions about these requirements, ask in class or lab.

If this base functionality turns out to be too easy, you may experiment with adding additional functions, but be sure the basic requirements are still met.

Try to divide up the primary responsibility for parts of the program in an equitable way.

Hints and Notes

Submission (Due Monday, 9/29/2014, 9PM)

One team member should submit your Python file by uploading to the CS-2910-031 Submissions folder on box.msoe.edu. If you have questions about this process, consult the instructor well in advance of the submission deadline.

Please follow these submission instructions exactly, including details of the filename, or your submission may be rejected, resulting in a "F" grade.