Uniform Resource Locator - Computer Programming - Lecture Notes, Study notes of Computer Engineering and Programming

Uniform Resource Locator, HTML, Web Browser, HTTP, Multipurpose Internet Mail Extensions, Request for Comments, Encoding and Decoding, Encoding Example Escape Sequence. As you can see in this file, how descriptive above mentioned points are explained in this lecture of computer programming. VU is one of best university for computer science in our country.

Typology: Study notes

2011/2012

Uploaded on 11/06/2012

ahsen
ahsen 🇵🇰

4.6

(88)

84 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 29
29.1 LECTURE GOAL 2
29.2 UNIFORM RESOURCE LOCATOR (URL) 2
29.3 HTML 2
29.4 WEB BROWSER 2
29.5 HTTP 3
29.6 MIME 3
29.7 RFC 3
29.8 ENCODING AND DECODING 3
29.9 ENCODING EXAMPLE ESCAPE SEQUENCE 3
29.10 VIRTUAL DIRECTORY 4
29.11 WEB BROWSER FETCHES A PAGES 4
29.12 HTTP CLIENT REQUEST 4
29.13 FILE EXTENSION AND MIME 5
29.14 MIME ENCODING 5
29.15 HTTP STATUS CODES 6
29.16 HTTP REDIRECTION 6
29.17 HTTP REQUEST PER 1 TCP/IP CONNECTION 6
29.18 SERVER ARCHITECTURE 7
SUMMARY 7
EXERCISES 7
pf3
pf4
pf5

Partial preview of the text

Download Uniform Resource Locator - Computer Programming - Lecture Notes and more Study notes Computer Engineering and Programming in PDF only on Docsity!

  • Chapter
  • 29.1 LECTURE G OAL
  • 29.2 UNIFORM RESOURCE LOCATOR (URL)
  • 29.3 HTML
  • 29.4 WEB BROWSER
  • 29.5 HTTP
  • 29.6 MIME
  • 29.7 RFC
  • 29.8 ENCODING AND DECODING
  • 29.9 ENCODING EXAMPLE ESCAPE S EQUENCE
  • 29.10 VIRTUAL DIRECTORY
  • 29.11 WEB BROWSER F ETCHES A PAGES
  • 29.12 HTTP CLIENT REQUEST
  • 29.13 F ILE EXTENSION AND MIME
  • 29.14 MIME ENCODING
  • 29.15 HTTP S TATUS CODES
  • 29.16 HTTP REDIRECTION
  • 29.17 HTTP REQUEST PER 1 TCP/IP CONNECTION
  • 29.18 S ERVER ARCHITECTURE
  • S UMMARY
  • EXERCISES

29.1 Lecture Goal

This lecture goal is to develop a little Web Server. This Web Server will serve HTTP requests, sent via a Web Browser using following URLs:

http://www.vu.edu.pk/default.html http://www.vu.edu.pk/index.asp http://www.vu.edu.pk/win32.html http://www.vu.edu.pk/courses/win32.html

29.2 Uniform Resource Locator (URL)

Anatomy of a URL (Uniform Resource Locator): http://www.vu.edu.pk/courses/win32.html http:// protocol www.vu.edu.pk Web Server

courses/win32.html location of file on server

Or http://www.vu.edu.pk:80/.../....

:80 is the specifies Port Number to use for connection

29.3 HTML

HTML stands for Hyper Text Mark-up Language. This language contains text-formatting information e.g. font faces, font colors, font sizes, alignment etc. and also contains HyperLinks : text that can be clicked to go to another HTML document on the Internet. HTML tags are embedded within normal text to make it hypertext.

29.4 Web Browser

HTTP Client – a Web Browser examples are: Microsoft Internet Explorer Netscape Navigator

These web servers connect to your HTTP web server, requests a document, and displays in its window

29.10 Virtual Directory

Represents the Home Directory of a Web Server

IIS (Internet Information Server) has c:\inetpub\wwwroot\ as its default Home Directory

Here, /courses/ either corresponds to a Physical Directory c:\inetpub\wwwroot\courses OR Virtual Directoy

In a Web Server, we may specify that /courses/ will represent some other physical directory on the Web Server like D:\MyWeb. Then /courses/ will be a Virtual Directory. In Windows2000 and IIS 5.0 (Internet Information Server), a folder’s “Web Sharing…” is used to create a Virtual Directory for any folder.

29.11 Web Browser Fetches a pages

  • http://www.vu.edu.pk/courses/win32.html
  • Hostname/DNS lookup for www.vu.edu.pk to get IP address
  • HTTP protocol uses port 80.
  • Connect to port 80 of the IP address discovered above!
  • Request the server for /courses/win32.html

29.12 HTTP Client Request

GET /courses/win32.html HTTP/1.

Request line is followed by 2 Carriage-Return /Line-feed sequences

Method Resource Identifier

HTTP

Version

Crlf

Crlf

HTTP/1.1 200 OK }Status Line

Content-type: text/html Content-Length:2061 Headers delimited by CR/LF sequence

Crlf

Actual data follows the headers

29.13 File Extension and MIME

File extensions are non-standard across different platforms and cannot be used to determine the type of contents of any file.

Different common MIME types

image/gif GIF image image/jpeg JPEG image text/html HTML document text/plain plain text

In an HTTP response, a Web Server tells the browser MIME type of data being sent

MIME type is used by the browser to handle the data appropriately i.e. show an image, display HTML etc.

MIME:

MIME: Multi-purpose Internet Mail Extensions MIME Encoding features were added to enable transfer of binary data, e.g. images (GIF, JPEG etc.) via mail. Using MIME encoding HTTP can now transfer complex binary data, e.g. images and video

29.14 MIME Encoding

MIME: Short for Multipurpose Internet Mail Extensions, a specification for formatting non-ASCII messages so that they can be sent over the Internet.

HTTP version Status Code Description

29.18 Server Architecture

Our server architecture will be based upon the following points

  • Ability to serve up to 5 clients simultaneously
  • Multi-threaded HTTP Web Server
  • 1 thread dedicated to accept client connections
  • 1 thread per client to serve HTTP requests
  • 1 thread dedicated to perform termination housekeeping of communication threads
  • Use of Synchronization Objects

Many WinSock function calls e.g. accept() are blocking calls Server needs to serve up 5 clients simultaneously. Using other WinSock blocking calls, need to perform termination tasks for asynchronously terminating communication threads.

Summary

In this lecture, we studied some terms and their jobs. We studied HTTP (hyper text transfer protocol) which is used to transfer text data across the net work. We also studied HTML that is hyper text markup language which is simply a text script. Html is loaded in web browser and web browser translates the text and executes instruction written in form of text. For transferring media like image data and movie data, we overviewed MIME.

Note: For example and more information connect to Virtual University resource Online.

Exercises

  1. Create a chat application. Using that application, you should be able to chat with your friend on network.