SlideShare une entreprise Scribd logo
1  sur  42
Chapter 27 HTTP and WWW
27.1  HTTP Transaction Request Message Response Message Headers
HTTP uses the services of TCP on well-known port 80. Note :
Figure 27.1   HTTP transaction
Figure 27.2   Request message
Figure 27.3   Request line
Figure 27.4   URL
Figure 27.5   Response message
Figure 27.6   Status line
Figure 27.7   Header format
Figure 27.8   Headers
Example 1 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in GIF and JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Fig. 27.9, next slide).
Figure 27.9   Example 1
Example 2 This example retrieves information about a document. We use the HEAD method to retrieve information about an HTML document (see the next section). The request line shows the method (HEAD), URL, and HTTP version (1.1). The header is one line showing that the client can accept the document in any format (wild card). The request does not have a body. The response message contains the status line and five lines of header. The header lines define the date, server, MIME version, type of document, and length of the document (see Fig. 27.10, next slide). Note that the response message does not contain a body.
Figure 27.10   Example 2
HTTP version 1.1 specifies a persistent connection by default.  Note :
27.2  World Wide Web Hypertext and Hypermedia Browser Architecture Static Document/HTML Dynamic Document/CGI Active Document/Java
Figure 27.11   Distributed services
Figure 27.12   Hypertext
Figure 27.13   Browser architecture
Figure 27.14   Categories of Web documents
Figure 27.15   Static document
Figure 27.16   Boldface tags
Figure 27.17   Effect of boldface tags
Figure 27.18   Beginning and ending tags
Table 27.1  Common tags  Skeletal Tags </Hn> </TITLE> </BODY> </HEAD> </HTML> Ending  Tag Defines the title of the document <Hn> Defines the title of the document <TITLE> Title and Header Tags Defines the body of the document <BODY> Defines the head of the document <HEAD> Defines an HTML document <HTML> Meaning Beginning Tag
Table 27.1  Common tags (continued)  Superscript </SUP> <SUP> Subscript </SUB> <SUB> Text Formatting Tags </BR> </CENTER> </U> </I> </B> Ending  Tag Line break <BR> Centered <CENTER> Data Flow Tag Underlined <U> Italic <I> Boldface <B> Meaning Beginning Tag
Table 27.1  Common tags (continued)  Executable Contents The document is an applet </APPLET> <APPLET> Hyperlink Tag Defines an address (hyperlink) </A> <A> List Tags </LI> </UL> </OL> Ending  Tag Defines an image <IMG> Image Tag An item in a list <LI> Unordered list <UL> Ordered list <OL> Meaning Beginning Tag
Example 3 This example shows how tags are used to let the browser format the appearance of the text. <HTML> <HEAD> <TITLE>  First Sample Document  </TITLE> </HEAD> <BODY> <CENTER>   <H1><B>   ATTENTION  </B></H1> </CENTER>   You can get a copy of this document by: <UL> <LI>  Writing to the publisher <LI>  Ordering online <LI>  Ordering through a bookstore </UL> </BODY> </HTML>
Example 4 This example shows how tags are used to import an image and insert it into the text. <HTML> <HEAD> <TITLE>  Second Sample Document  </TITLE> </HEAD> <BODY> This is the picture of a book: <IMG SRC=&quot;Pictures/book1.gif&quot;  ALIGN=MIDDLE> </BODY> </HTML>
Example 5 This example shows how tags are used to make a hyperlink to another document. <HTML> <HEAD> <TITLE>  Third Sample Document  </TITLE> </HEAD> <BODY> This is a wonderful product that can save you money and time. To get information about the producer, click on  <A HREF=&quot;http://www.phony.producer&quot;> Producer </A> </BODY> </HTML>
Figure 27.19   Dynamic document
Example 6 Example 6 is a CGI program written in Bourne shell script. The program accesses the UNIX utility (date) that returns the date and the time. Note that the program output is in plain text. #!/bin/sh  # The head of the program echo Content_type: text/plain echo # The body of the program now='date' echo  $now exit 0
Example 7 Example 7 is similar to Example 6 except that program output is in HTML. #!/bin/sh  #  The head of the program echo Content_type: text/html echo #  The body of the program echo <HTML> echo <HEAD><TITLE> Date and Time </TITLE></HEAD> echo <BODY> now='date' echo <CENTER><B> $now </B></CENTER> echo </BODY> echo </HTML> exit 0
Example 8 Example 8 is similar to Example 7 except that the program is written in Perl. #!/bin/perl  #  The head of the program print  &quot;Content_type: text/html&quot;; print &quot;&quot;; #  The body of the program print &quot;<HTML>&quot;; print &quot;<HEAD><TITLE> Date and Time </TITLE></HEAD>&quot;; print &quot;<BODY>&quot;; $now = 'date'; print &quot;<CENTER><B>  $now </B></CENTER>&quot;; print &quot;</BODY>&quot;; print &quot;</HTML>&quot;; exit 0
Figure 27.20   Active document
Figure 27.21   Skeleton of an applet
Figure 27.22   Instantiation of the object defined by an applet
Figure 27.23   Creation and compilation
Figure 27.24   HTML document carrying an applet
Example 9 In this example, we first import two packages, java.awt and java.applet. They contain the declarations and definitions of classes and methods that we need. Our example uses only one publicly  inherited  class called First. We define only one public method, paint. The browser can access the instance of First through the public method paint. The paint method, however, calls another method called drawString, which is defined in java.awt.*.  import java.applet.*; import java.awt.*; public class First extends Applet {   public void paint (Graphics  g)   {   g.drawString (&quot;Hello World&quot;, 100, 100);   } }
Example 10 In this example, we modify the program in Example 9 to draw a line. Instead of method drawString, we use another method called drawLine. This method needs four parameters: the x and y coordinates at the beginning of the line and the x and y coordinates at the end of the line. We use 0, 0 for the beginning and 80, 90 for the end. import java.applet.*; import java.awt.*; public class Second extends Applet {   public void paint (Graphics  g)   {   g.drawLine (0, 0, 80, 90);   } }

Contenu connexe

Tendances (20)

Tm 1st quarter - 1st meeting
Tm   1st quarter - 1st meetingTm   1st quarter - 1st meeting
Tm 1st quarter - 1st meeting
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical list
 
Week 2
Week 2Week 2
Week 2
 
Unit 2.3 Part 1
Unit 2.3 Part 1Unit 2.3 Part 1
Unit 2.3 Part 1
 
WEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTMLWEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTML
 
CSS
CSSCSS
CSS
 
static dynamic html tags
static dynamic html tagsstatic dynamic html tags
static dynamic html tags
 
Intro Html
Intro HtmlIntro Html
Intro Html
 
Htmltag.ppt
Htmltag.pptHtmltag.ppt
Htmltag.ppt
 
Html
HtmlHtml
Html
 
Introduction to html (912 kb)
Introduction to html (912 kb)Introduction to html (912 kb)
Introduction to html (912 kb)
 
Html
HtmlHtml
Html
 
Module 1
Module 1Module 1
Module 1
 
Final by smit parekh
Final  by smit  parekhFinal  by smit  parekh
Final by smit parekh
 
List of html tags
List of html tagsList of html tags
List of html tags
 
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Html
HtmlHtml
Html
 
HTML Basic Tags PDF by CodeHim
HTML Basic Tags PDF by CodeHimHTML Basic Tags PDF by CodeHim
HTML Basic Tags PDF by CodeHim
 
HyperText Markup Language - HTML
HyperText Markup Language - HTMLHyperText Markup Language - HTML
HyperText Markup Language - HTML
 

En vedette (20)

Ch 20
Ch 20Ch 20
Ch 20
 
Ch 31
Ch 31Ch 31
Ch 31
 
Ch 29
Ch 29Ch 29
Ch 29
 
Ch 28
Ch 28Ch 28
Ch 28
 
Ch 24
Ch 24Ch 24
Ch 24
 
Ch 07
Ch 07Ch 07
Ch 07
 
Ch 16
Ch 16Ch 16
Ch 16
 
Ch 12
Ch 12Ch 12
Ch 12
 
Ch 23
Ch 23Ch 23
Ch 23
 
Ch 18
Ch 18Ch 18
Ch 18
 
Ch14
Ch14Ch14
Ch14
 
Ch 26
Ch 26Ch 26
Ch 26
 
Ch 30
Ch 30Ch 30
Ch 30
 
Ch 14
Ch 14Ch 14
Ch 14
 
Ch 25
Ch 25Ch 25
Ch 25
 
Ch 02
Ch 02Ch 02
Ch 02
 
Ch 13
Ch 13Ch 13
Ch 13
 
Ch 19
Ch 19Ch 19
Ch 19
 
Ch 15
Ch 15Ch 15
Ch 15
 
Ch 10
Ch 10Ch 10
Ch 10
 

Similaire à Ch 27

Download Workshop Lecture
Download Workshop LectureDownload Workshop Lecture
Download Workshop Lecturewebhostingguy
 
How To Create Personal Web Pages On My Web
How To Create Personal Web Pages On My WebHow To Create Personal Web Pages On My Web
How To Create Personal Web Pages On My Websritikumar
 
Xhtml Part2
Xhtml Part2Xhtml Part2
Xhtml Part2nleesite
 
CIS 451: Introduction to ASP.NET
CIS 451: Introduction to ASP.NETCIS 451: Introduction to ASP.NET
CIS 451: Introduction to ASP.NETwebhostingguy
 
Introduction To ASP.NET MVC
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVCAlan Dean
 
HTML (Hyper Text Markup Language) Project
HTML (Hyper Text Markup Language) Project HTML (Hyper Text Markup Language) Project
HTML (Hyper Text Markup Language) Project Ankit Gupta
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpointwebhostingguy
 
Web designing using html
Web designing using htmlWeb designing using html
Web designing using htmljulicris021488
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 

Similaire à Ch 27 (20)

Before start
Before startBefore start
Before start
 
Download Workshop Lecture
Download Workshop LectureDownload Workshop Lecture
Download Workshop Lecture
 
How To Create Personal Web Pages On My Web
How To Create Personal Web Pages On My WebHow To Create Personal Web Pages On My Web
How To Create Personal Web Pages On My Web
 
HTML
HTMLHTML
HTML
 
Intro to html
Intro to htmlIntro to html
Intro to html
 
Intro to html
Intro to htmlIntro to html
Intro to html
 
Tugas Pw [6]
Tugas Pw [6]Tugas Pw [6]
Tugas Pw [6]
 
Tugas Pw [6] (2)
Tugas Pw [6] (2)Tugas Pw [6] (2)
Tugas Pw [6] (2)
 
Xhtml Part2
Xhtml Part2Xhtml Part2
Xhtml Part2
 
CIS 451: Introduction to ASP.NET
CIS 451: Introduction to ASP.NETCIS 451: Introduction to ASP.NET
CIS 451: Introduction to ASP.NET
 
HTML5
HTML5HTML5
HTML5
 
Introduction To ASP.NET MVC
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVC
 
HTML (Hyper Text Markup Language) Project
HTML (Hyper Text Markup Language) Project HTML (Hyper Text Markup Language) Project
HTML (Hyper Text Markup Language) Project
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
Html
HtmlHtml
Html
 
Web designing using html
Web designing using htmlWeb designing using html
Web designing using html
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 

Plus de soumya ranjan mohanty (11)

Ch 22
Ch 22Ch 22
Ch 22
 
Ch 21
Ch 21Ch 21
Ch 21
 
Ch 17
Ch 17Ch 17
Ch 17
 
Ch 11
Ch 11Ch 11
Ch 11
 
Ch 09
Ch 09Ch 09
Ch 09
 
Ch 08
Ch 08Ch 08
Ch 08
 
Ch 06
Ch 06Ch 06
Ch 06
 
Ch 05
Ch 05Ch 05
Ch 05
 
Ch 04
Ch 04Ch 04
Ch 04
 
Ch 03
Ch 03Ch 03
Ch 03
 
Ch 1
Ch 1Ch 1
Ch 1
 

Dernier

Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMuzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Cricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfLatiyalinfotech
 
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docxSlovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docxWorld Wide Tickets And Hospitality
 
Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...
Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...
Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...Eticketing.co
 
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)Delhi Call girls
 
European Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docxEuropean Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docxEuro Cup 2024 Tickets
 
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room packageWhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room packageNitya salvi
 
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...Nitya salvi
 
Who Is Emmanuel Katto Uganda? His Career, personal life etc.
Who Is Emmanuel Katto Uganda? His Career, personal life etc.Who Is Emmanuel Katto Uganda? His Career, personal life etc.
Who Is Emmanuel Katto Uganda? His Career, personal life etc.Marina Costa
 
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdfJORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdfArturo Pacheco Alvarez
 
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxSpain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxWorld Wide Tickets And Hospitality
 
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxEuro Cup 2024 Tickets
 
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics TradeTechnical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics TradeOptics-Trade
 
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...Eticketing.co
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartChart Kalyan
 
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls AgencyHire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls AgencyNitya salvi
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennisjocksofalltradespodc
 
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...
Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...
Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...Euro Cup 2024 Tickets
 

Dernier (20)

Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMuzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Muzaffarpur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdf
 
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docxSlovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
 
Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...
Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...
Austria vs France Austria Euro 2024 squad Ralf Rangnick's full team ahead of ...
 
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sheikh Sarai (Delhi)
 
European Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docxEuropean Football Icons that Missed Opportunities at UEFA Euro 2024.docx
European Football Icons that Missed Opportunities at UEFA Euro 2024.docx
 
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room packageWhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
 
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
 
Who Is Emmanuel Katto Uganda? His Career, personal life etc.
Who Is Emmanuel Katto Uganda? His Career, personal life etc.Who Is Emmanuel Katto Uganda? His Career, personal life etc.
Who Is Emmanuel Katto Uganda? His Career, personal life etc.
 
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdfJORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
 
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxSpain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
 
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
 
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics TradeTechnical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
 
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar Chart
 
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls AgencyHire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennis
 
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Slovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docxSlovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docx
 
Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...
Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...
Exploring Euro Cup 2024 Host Cities in Germany Top Attractions and Accommodat...
 

Ch 27

  • 1. Chapter 27 HTTP and WWW
  • 2. 27.1 HTTP Transaction Request Message Response Message Headers
  • 3. HTTP uses the services of TCP on well-known port 80. Note :
  • 4. Figure 27.1 HTTP transaction
  • 5. Figure 27.2 Request message
  • 6. Figure 27.3 Request line
  • 8. Figure 27.5 Response message
  • 9. Figure 27.6 Status line
  • 10. Figure 27.7 Header format
  • 11. Figure 27.8 Headers
  • 12. Example 1 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in GIF and JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Fig. 27.9, next slide).
  • 13. Figure 27.9 Example 1
  • 14. Example 2 This example retrieves information about a document. We use the HEAD method to retrieve information about an HTML document (see the next section). The request line shows the method (HEAD), URL, and HTTP version (1.1). The header is one line showing that the client can accept the document in any format (wild card). The request does not have a body. The response message contains the status line and five lines of header. The header lines define the date, server, MIME version, type of document, and length of the document (see Fig. 27.10, next slide). Note that the response message does not contain a body.
  • 15. Figure 27.10 Example 2
  • 16. HTTP version 1.1 specifies a persistent connection by default. Note :
  • 17. 27.2 World Wide Web Hypertext and Hypermedia Browser Architecture Static Document/HTML Dynamic Document/CGI Active Document/Java
  • 18. Figure 27.11 Distributed services
  • 19. Figure 27.12 Hypertext
  • 20. Figure 27.13 Browser architecture
  • 21. Figure 27.14 Categories of Web documents
  • 22. Figure 27.15 Static document
  • 23. Figure 27.16 Boldface tags
  • 24. Figure 27.17 Effect of boldface tags
  • 25. Figure 27.18 Beginning and ending tags
  • 26. Table 27.1 Common tags Skeletal Tags </Hn> </TITLE> </BODY> </HEAD> </HTML> Ending Tag Defines the title of the document <Hn> Defines the title of the document <TITLE> Title and Header Tags Defines the body of the document <BODY> Defines the head of the document <HEAD> Defines an HTML document <HTML> Meaning Beginning Tag
  • 27. Table 27.1 Common tags (continued) Superscript </SUP> <SUP> Subscript </SUB> <SUB> Text Formatting Tags </BR> </CENTER> </U> </I> </B> Ending Tag Line break <BR> Centered <CENTER> Data Flow Tag Underlined <U> Italic <I> Boldface <B> Meaning Beginning Tag
  • 28. Table 27.1 Common tags (continued) Executable Contents The document is an applet </APPLET> <APPLET> Hyperlink Tag Defines an address (hyperlink) </A> <A> List Tags </LI> </UL> </OL> Ending Tag Defines an image <IMG> Image Tag An item in a list <LI> Unordered list <UL> Ordered list <OL> Meaning Beginning Tag
  • 29. Example 3 This example shows how tags are used to let the browser format the appearance of the text. <HTML> <HEAD> <TITLE> First Sample Document </TITLE> </HEAD> <BODY> <CENTER> <H1><B> ATTENTION </B></H1> </CENTER> You can get a copy of this document by: <UL> <LI> Writing to the publisher <LI> Ordering online <LI> Ordering through a bookstore </UL> </BODY> </HTML>
  • 30. Example 4 This example shows how tags are used to import an image and insert it into the text. <HTML> <HEAD> <TITLE> Second Sample Document </TITLE> </HEAD> <BODY> This is the picture of a book: <IMG SRC=&quot;Pictures/book1.gif&quot; ALIGN=MIDDLE> </BODY> </HTML>
  • 31. Example 5 This example shows how tags are used to make a hyperlink to another document. <HTML> <HEAD> <TITLE> Third Sample Document </TITLE> </HEAD> <BODY> This is a wonderful product that can save you money and time. To get information about the producer, click on <A HREF=&quot;http://www.phony.producer&quot;> Producer </A> </BODY> </HTML>
  • 32. Figure 27.19 Dynamic document
  • 33. Example 6 Example 6 is a CGI program written in Bourne shell script. The program accesses the UNIX utility (date) that returns the date and the time. Note that the program output is in plain text. #!/bin/sh # The head of the program echo Content_type: text/plain echo # The body of the program now='date' echo $now exit 0
  • 34. Example 7 Example 7 is similar to Example 6 except that program output is in HTML. #!/bin/sh # The head of the program echo Content_type: text/html echo # The body of the program echo <HTML> echo <HEAD><TITLE> Date and Time </TITLE></HEAD> echo <BODY> now='date' echo <CENTER><B> $now </B></CENTER> echo </BODY> echo </HTML> exit 0
  • 35. Example 8 Example 8 is similar to Example 7 except that the program is written in Perl. #!/bin/perl # The head of the program print &quot;Content_type: text/html&quot;; print &quot;&quot;; # The body of the program print &quot;<HTML>&quot;; print &quot;<HEAD><TITLE> Date and Time </TITLE></HEAD>&quot;; print &quot;<BODY>&quot;; $now = 'date'; print &quot;<CENTER><B> $now </B></CENTER>&quot;; print &quot;</BODY>&quot;; print &quot;</HTML>&quot;; exit 0
  • 36. Figure 27.20 Active document
  • 37. Figure 27.21 Skeleton of an applet
  • 38. Figure 27.22 Instantiation of the object defined by an applet
  • 39. Figure 27.23 Creation and compilation
  • 40. Figure 27.24 HTML document carrying an applet
  • 41. Example 9 In this example, we first import two packages, java.awt and java.applet. They contain the declarations and definitions of classes and methods that we need. Our example uses only one publicly inherited class called First. We define only one public method, paint. The browser can access the instance of First through the public method paint. The paint method, however, calls another method called drawString, which is defined in java.awt.*. import java.applet.*; import java.awt.*; public class First extends Applet { public void paint (Graphics g) { g.drawString (&quot;Hello World&quot;, 100, 100); } }
  • 42. Example 10 In this example, we modify the program in Example 9 to draw a line. Instead of method drawString, we use another method called drawLine. This method needs four parameters: the x and y coordinates at the beginning of the line and the x and y coordinates at the end of the line. We use 0, 0 for the beginning and 80, 90 for the end. import java.applet.*; import java.awt.*; public class Second extends Applet { public void paint (Graphics g) { g.drawLine (0, 0, 80, 90); } }