And, at last, we have to explore the client side. Instead of using telnet or a standard Web browser, we will write our own Web client. The two main tasks of a Web client are:
![]() | Exercise 1.9. The Web client code | ||||||||||||||||||||
|
import browser
| |||||||||||||||||||||
![]() | Exercise 1.10. Use the Web client |
|
Use the client script defined in Exercise 1.9 to request the server defined in Exercise 1.6: % python -i tiny_client.py feu.sis.pasteur.fr 2122 tralalaThen Use this client script to get the home page of the Pasteur Institute Web server: what happens? % python -i tiny_client.py www.pasteur.frIssue a more precise request, such as: % python -i tiny_client.py www.pasteur.fr 80 /formation/infobio/Is that better? It seems OK, but it is still non-handled HTML. So, what about asking for a non-HTML document: % python -i tiny_client.py www.pasteur.fr 80 /formation/infobio/2003/python/solutions/sol_code/fasta_fetcher.py | |
![]() | Exercise 1.11. Enhance the Web client |
|
Add a field displaying the date of the fetched document to the browser (defined in Exercise 1.9). The date of the document lies in the last-modified header. For this purpose, you will have to:
| |