Web application Architecture and HTTP Protocol By: Mr. PHUPHA PUNYAPOTASAKUL ( ภูผา ปัญญาโพธาสกุล )
World Wide Web HTML HTTP TCP/IP Network Layer
HTTP Protocol Hypertext Transfer Protocol  ( HTTP ) is a  communications protocol  used to transfer or convey information on  intranets  and the  World Wide Web . Its original purpose was to provide a way to publish and retrieve  hypertext  pages. Development of HTTP was coordinated by the W3C ( World Wide Web Consortium ) and the IETF ( Internet Engineering Task Force ), culminating in the publication of a series of  RFCs , most notably  RFC 2616  ( June 1999 ), which defines HTTP/1.1, the version of HTTP in common use.
HTTP Specification HTTP 1.1 http://tools.ietf.org/html/rfc2616 HTTP 1.0 http://tools.ietf.org/html/rfc1945
HTTP Request/Response Server Browser HTTP Response HTTP Request
HTTP Request Methods HEAD Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. GET Requests a representation of the specified resource. By far the most common method used on the Web today. Should not be used for operations that cause side-effects (using it for actions in  web applications  is a common misuse). See 'safe methods' below. POST Submits data to be processed (e.g. from an  HTML form ) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.
HTTP Request Methods PUT Uploads a representation of the specified resource. DELETE Deletes the specified resource. TRACE Echoes back the received request, so that a client can see what intermediate servers are adding or changing in the request. OPTIONS Returns the HTTP methods that the server supports. This can be used to check the functionality of a web server. CONNECT Converts the request connection to a transparent  TCP / IP tunnel , usually to facilitate  SSL -encrypted communication (HTTPS) through an unencrypted HTTP  proxy . [ 1 ]
HTTP Example HTTP Request GET /index.html HTTP/1.1 Host:  www.example.com HTTP Response HTTP / 1.1   200 OK Date :  Mon, 23 May 2005   22:38:34 GMT Server :  Apache / 1.3.27  ( Unix )  ( Red - Hat / Linux ) Last - Modified :  Wed, 08 Jan 2003   23:11:55 GMT Accept - Ranges :  bytes Content - Length :  438 Connection :  close Content - Type :  text / html; charset = UTF-8 <HTML> <HEAD> <TITLE>Title</TITLE> … .
HTML
HTML Example <html> <head> <title>Title< / title> <meta http - equiv =&quot; Content - Type &quot;  content =&quot; text / html; charset = utf-8 &quot; > <link href =&quot;../ style / framework . css &quot;  rel =&quot; stylesheet &quot;  type =&quot; text / css &quot; > <script language =&quot; JavaScript &quot;  src =&quot;../ script / framework / config . js &quot; >< / script> < / head> <body leftmargin =&quot; 0 &quot;  topmargin =&quot; 0 &quot;  marginwidth =&quot; 0 &quot;  marginheight =&quot; 0 &quot; > … . … .. … . </body> </html>
HTML Specification Reference http :// www . w3 . org / TR / html4 / Maintain by Support History http:// www.eskimo.com/~bloo/indexdot/html/supportkey/a.htm
How does it work? Browser HTTP Request TCP/IP Packet Network
How does it work? Server HTTP Request TCP/IP Packet Network HTML Output HTTP Response TCP/IP Packet
How does it work? Browser Network HTML Output HTTP Response TCP/IP Packet
Question If HTTP message is larger than TCP/IP packet’s max length, what will happen? Is it possible to have more than one web site in the same server? How does it work? How can we know the server’s IP address
TCP/IP Each TCP/IP connection Source IP Source Port Destination IP Destination Port Reliable transmission Establish connection before transmit More overhead than UDP
Virtual Host Multi domain name in one server Each domain name have their own content, files, resource and etc. separately Domain name come from HTTP Request message Where IP come from?
HTTP  Persistent Connection Send multi HTTP Request in one connection Why? Reduce overhead Get response faster
HTTP Session State HTTP is a stateless protocol Web server implementation much easier and much more effective Dynamic content? Control session on application level
More detail about HTTP HTTP Header specification http :// en . wikipedia . org / wiki / List_of_HTTP_headers HTTP Status code http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP Compression Reduce bandwidth Use Content - Encoding
Server concept Application HTTP Request HTTP Response
Server concept Web Server HTTP Request Request parameter Server Page Server Page Server Page Server Page Use URI pattern to select which page to run.. HTML Output   +  Response parameter HTTP Response
E.g. JSP Web Server Server Page Request  Object Response Object
URL Uniform Resource Locators  ( URLs )  are strings that specify how to access network resources, such as HTML documents .  They are part of the more general class of Universal Resource Identifiers  ( URIs ).  The most important use of URLs is in HTML documents to identify the targets of hyperlinks .  When using a Web browser such as Netscape, every highlighted region has a URL associated with it, which is accessed when the link is activated by a mouse click .  Relative URLs  specify only a portion of the full URL  -  the missing information is inferred though the context of the source document .
Secure Socket Layer Secure Sockets Layer  ( SSL ), are  cryptographic protocols  that provide  secure  communications on the  Internet  for such things as  web browsing ,  e - mail ,  Internet faxing ,  instant messaging  and other data transfers.  URL pattern – https:// For HTTP, normally use port 443 More detail later
Web Cookie s HTTP cookies , sometimes known as  web cookies  or just  cookies , are parcels of text sent by a  server  to a  web   browser  and then sent back unchanged by the browser each time it accesses that server.  HTTP  cookies are used for  authenticating , tracking, and maintaining specific information about users, such as site preferences and the contents of their  electronic shopping carts . The term &quot;cookie&quot; is derived from &quot; magic cookie ,&quot; a well-known concept in  unix  computing which inspired both the idea and the name of HTTP cookies.
Web Cookies
Session Normally manage by web server Use cookie to help keeping session id or session identifier Session timeout, unused data will be cleared from memory
Session Browser Web Server Session  ID Cookie Session  Data Session  Data Session  Data Session  Data Browser Session  ID Cookie
Question If we close browser, will the cookie disappear ? Can we change value in cookie manually? How to open web site in a new session Open new browser window?

More Related Content

PDF
Http methods
PPTX
HTTP request and response
PPTX
Http request and http response
PPTX
Http headers
PPTX
PPTX
HTTP Request Header and HTTP Status Code
PPTX
HTTP fundamentals for developers
Http methods
HTTP request and response
Http request and http response
Http headers
HTTP Request Header and HTTP Status Code
HTTP fundamentals for developers

What's hot (20)

PPTX
ODP
PHP Training: Module 1
PPTX
Web (HTTP) request to response life cycle
PPTX
Http - All you need to know
KEY
What's up with HTTP?
PDF
HTTP - The Protocol of Our Lives
PDF
Lec 7(HTTP Protocol)
PPTX
PPT
Http request&response by Vignesh 15 MAR 2014
PPTX
HTTP Protocol Basic
PPTX
Http protocol
PDF
21 HTTP Protocol #burningkeyboards
PDF
RESTful Web Services
PDF
HTTP Definition and Basics.
PPTX
Http basics by-joshi_29_4_15-ppt
PPTX
01. http basics v27
PPTX
Hypertext Transfer Protocol
PPT
Restful web services
PPTX
PPTX
Http-protocol
PHP Training: Module 1
Web (HTTP) request to response life cycle
Http - All you need to know
What's up with HTTP?
HTTP - The Protocol of Our Lives
Lec 7(HTTP Protocol)
Http request&response by Vignesh 15 MAR 2014
HTTP Protocol Basic
Http protocol
21 HTTP Protocol #burningkeyboards
RESTful Web Services
HTTP Definition and Basics.
Http basics by-joshi_29_4_15-ppt
01. http basics v27
Hypertext Transfer Protocol
Restful web services
Http-protocol

Viewers also liked (20)

PPT
International Day in Oriveden Keskuskoulu 2011
PPT
Cineas Corso Taylor Made Per Zurich 27 Aprile 2010 Mattina
PPTX
Askartelukerho kevät 2011
PDF
Formative Capitalism
PDF
Economic Control or Reform or Structural Change : Occupy the 1?
PPT
Student Investment Fund
KEY
Denver Green Car Presentation
PDF
Can Taltavuit Ibiza. Magnificient Villa for Vacation Rentals in Ibiza
PPT
PPTX
etwinning Learning Events - Pedagogical Objectives
PPTX
Eurooppalainen verkosto OPS:n resurssina – esimerkkinä eTwinning
PDF
How to add a canvas to your image
PPT
Tactiek verdedigen
PPT
Aubergine Parmigiana - Recipe
PPT
MVT Asia Presentation
PDF
Mentoriohjelma kansainvalisyyspaivat 2012
PDF
SRI Brochure -- Boardwalk Capital
PPT
Springtime in Orivesi
PPT
Orivesi - Down the Mainstreet
PDF
Unleash the 95%
International Day in Oriveden Keskuskoulu 2011
Cineas Corso Taylor Made Per Zurich 27 Aprile 2010 Mattina
Askartelukerho kevät 2011
Formative Capitalism
Economic Control or Reform or Structural Change : Occupy the 1?
Student Investment Fund
Denver Green Car Presentation
Can Taltavuit Ibiza. Magnificient Villa for Vacation Rentals in Ibiza
etwinning Learning Events - Pedagogical Objectives
Eurooppalainen verkosto OPS:n resurssina – esimerkkinä eTwinning
How to add a canvas to your image
Tactiek verdedigen
Aubergine Parmigiana - Recipe
MVT Asia Presentation
Mentoriohjelma kansainvalisyyspaivat 2012
SRI Brochure -- Boardwalk Capital
Springtime in Orivesi
Orivesi - Down the Mainstreet
Unleash the 95%

Similar to KMUTNB - Internet Programming 2/7 (20)

PPTX
The HTTP and Web
PPTX
Web technology introduction to the web and its history
PPTX
www and http services
PPTX
http presentation 1.pptx
PPT
Http VS. Https
PDF
Introduction to HTTP
PPTX
HyperText Transfer Protocol (HTTP)
PPT
Web Services 2009
PPT
Web Services 2009
PPTX
Hypertex transfer protocol
PPTX
Hyper_Text_Transfer_Protocol_Presentation_
PDF
Hypertexttransferprotocolhttp 131012171813-phpapp02
PDF
Web Technologies Notes - TutorialsDuniya.pdf
PDF
Web Technologies Notes - TutorialsDuniya.pdf
PPT
Web Server Technologies I: HTTP
PPT
Web Server Technologies I: HTTP & Getting Started
PPTX
An Introduction to HTTP
PDF
02 - Asassssssspplication Layer (HTTP).pdf
PPT
HTTP.ppt
PPT
HTTP (syper text transfer protocol)(6).ppt
The HTTP and Web
Web technology introduction to the web and its history
www and http services
http presentation 1.pptx
Http VS. Https
Introduction to HTTP
HyperText Transfer Protocol (HTTP)
Web Services 2009
Web Services 2009
Hypertex transfer protocol
Hyper_Text_Transfer_Protocol_Presentation_
Hypertexttransferprotocolhttp 131012171813-phpapp02
Web Technologies Notes - TutorialsDuniya.pdf
Web Technologies Notes - TutorialsDuniya.pdf
Web Server Technologies I: HTTP
Web Server Technologies I: HTTP & Getting Started
An Introduction to HTTP
02 - Asassssssspplication Layer (HTTP).pdf
HTTP.ppt
HTTP (syper text transfer protocol)(6).ppt

More from phuphax (9)

PDF
GPS Tracking by Tracking.in.th
PPT
KMUTNB - Internet Programming 5/7
PPT
KMUTNB - Internet Programming 7/7
PPT
KMUTNB - Internet Programming 6/7
PPT
KMUTNB - Internet Programming 5/7
PPT
KMUTNB - Internet Programming 4/7
PPT
KMUTNB - Internet Programming 3/7
PPT
KMUTNB - Internet Programming 1/7
PPS
Abzolute Logistic Solution
GPS Tracking by Tracking.in.th
KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 7/7
KMUTNB - Internet Programming 6/7
KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 1/7
Abzolute Logistic Solution

Recently uploaded (20)

PDF
Physical pharmaceutics two in b pharmacy
PDF
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
DOCX
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
PPSX
namma_kalvi_12th_botany_chapter_9_ppt.ppsx
PDF
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
PDF
FYJC - Chemistry textbook - standard 11.
PDF
HSE and their team are going through the hazards of the issues with learning ...
PDF
Teacher's Day Quiz 2025
PDF
GSA-Past-Papers-2010-2024-2.pdf CSS examination
PDF
horaris de grups del curs 2025-2026 de l'institut
PDF
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
PDF
New_Round_Up_6_SB.pdf download for free, easy to learn
PDF
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
PPTX
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
PDF
Global strategy and action plan on oral health 2023 - 2030.pdf
PDF
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
PDF
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
PPTX
climate change of delhi impacts on climate and there effects
PDF
The 10 Most Inspiring Education Leaders to Follow in 2025.pdf
PDF
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
Physical pharmaceutics two in b pharmacy
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
namma_kalvi_12th_botany_chapter_9_ppt.ppsx
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
FYJC - Chemistry textbook - standard 11.
HSE and their team are going through the hazards of the issues with learning ...
Teacher's Day Quiz 2025
GSA-Past-Papers-2010-2024-2.pdf CSS examination
horaris de grups del curs 2025-2026 de l'institut
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
New_Round_Up_6_SB.pdf download for free, easy to learn
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
Global strategy and action plan on oral health 2023 - 2030.pdf
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
climate change of delhi impacts on climate and there effects
The 10 Most Inspiring Education Leaders to Follow in 2025.pdf
V02-Session-4-Leadership-Through-Assessment-MLB.pdf

KMUTNB - Internet Programming 2/7

  • 1. Web application Architecture and HTTP Protocol By: Mr. PHUPHA PUNYAPOTASAKUL ( ภูผา ปัญญาโพธาสกุล )
  • 2. World Wide Web HTML HTTP TCP/IP Network Layer
  • 3. HTTP Protocol Hypertext Transfer Protocol ( HTTP ) is a communications protocol used to transfer or convey information on intranets and the World Wide Web . Its original purpose was to provide a way to publish and retrieve hypertext pages. Development of HTTP was coordinated by the W3C ( World Wide Web Consortium ) and the IETF ( Internet Engineering Task Force ), culminating in the publication of a series of RFCs , most notably RFC 2616 ( June 1999 ), which defines HTTP/1.1, the version of HTTP in common use.
  • 4. HTTP Specification HTTP 1.1 http://tools.ietf.org/html/rfc2616 HTTP 1.0 http://tools.ietf.org/html/rfc1945
  • 5. HTTP Request/Response Server Browser HTTP Response HTTP Request
  • 6. HTTP Request Methods HEAD Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. GET Requests a representation of the specified resource. By far the most common method used on the Web today. Should not be used for operations that cause side-effects (using it for actions in web applications is a common misuse). See 'safe methods' below. POST Submits data to be processed (e.g. from an HTML form ) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.
  • 7. HTTP Request Methods PUT Uploads a representation of the specified resource. DELETE Deletes the specified resource. TRACE Echoes back the received request, so that a client can see what intermediate servers are adding or changing in the request. OPTIONS Returns the HTTP methods that the server supports. This can be used to check the functionality of a web server. CONNECT Converts the request connection to a transparent TCP / IP tunnel , usually to facilitate SSL -encrypted communication (HTTPS) through an unencrypted HTTP proxy . [ 1 ]
  • 8. HTTP Example HTTP Request GET /index.html HTTP/1.1 Host: www.example.com HTTP Response HTTP / 1.1 200 OK Date : Mon, 23 May 2005 22:38:34 GMT Server : Apache / 1.3.27 ( Unix ) ( Red - Hat / Linux ) Last - Modified : Wed, 08 Jan 2003 23:11:55 GMT Accept - Ranges : bytes Content - Length : 438 Connection : close Content - Type : text / html; charset = UTF-8 <HTML> <HEAD> <TITLE>Title</TITLE> … .
  • 10. HTML Example <html> <head> <title>Title< / title> <meta http - equiv =&quot; Content - Type &quot; content =&quot; text / html; charset = utf-8 &quot; > <link href =&quot;../ style / framework . css &quot; rel =&quot; stylesheet &quot; type =&quot; text / css &quot; > <script language =&quot; JavaScript &quot; src =&quot;../ script / framework / config . js &quot; >< / script> < / head> <body leftmargin =&quot; 0 &quot; topmargin =&quot; 0 &quot; marginwidth =&quot; 0 &quot; marginheight =&quot; 0 &quot; > … . … .. … . </body> </html>
  • 11. HTML Specification Reference http :// www . w3 . org / TR / html4 / Maintain by Support History http:// www.eskimo.com/~bloo/indexdot/html/supportkey/a.htm
  • 12. How does it work? Browser HTTP Request TCP/IP Packet Network
  • 13. How does it work? Server HTTP Request TCP/IP Packet Network HTML Output HTTP Response TCP/IP Packet
  • 14. How does it work? Browser Network HTML Output HTTP Response TCP/IP Packet
  • 15. Question If HTTP message is larger than TCP/IP packet’s max length, what will happen? Is it possible to have more than one web site in the same server? How does it work? How can we know the server’s IP address
  • 16. TCP/IP Each TCP/IP connection Source IP Source Port Destination IP Destination Port Reliable transmission Establish connection before transmit More overhead than UDP
  • 17. Virtual Host Multi domain name in one server Each domain name have their own content, files, resource and etc. separately Domain name come from HTTP Request message Where IP come from?
  • 18. HTTP Persistent Connection Send multi HTTP Request in one connection Why? Reduce overhead Get response faster
  • 19. HTTP Session State HTTP is a stateless protocol Web server implementation much easier and much more effective Dynamic content? Control session on application level
  • 20. More detail about HTTP HTTP Header specification http :// en . wikipedia . org / wiki / List_of_HTTP_headers HTTP Status code http://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP Compression Reduce bandwidth Use Content - Encoding
  • 21. Server concept Application HTTP Request HTTP Response
  • 22. Server concept Web Server HTTP Request Request parameter Server Page Server Page Server Page Server Page Use URI pattern to select which page to run.. HTML Output + Response parameter HTTP Response
  • 23. E.g. JSP Web Server Server Page Request Object Response Object
  • 24. URL Uniform Resource Locators ( URLs ) are strings that specify how to access network resources, such as HTML documents . They are part of the more general class of Universal Resource Identifiers ( URIs ). The most important use of URLs is in HTML documents to identify the targets of hyperlinks . When using a Web browser such as Netscape, every highlighted region has a URL associated with it, which is accessed when the link is activated by a mouse click . Relative URLs specify only a portion of the full URL - the missing information is inferred though the context of the source document .
  • 25. Secure Socket Layer Secure Sockets Layer ( SSL ), are cryptographic protocols that provide secure communications on the Internet for such things as web browsing , e - mail , Internet faxing , instant messaging and other data transfers. URL pattern – https:// For HTTP, normally use port 443 More detail later
  • 26. Web Cookie s HTTP cookies , sometimes known as web cookies or just cookies , are parcels of text sent by a server to a web browser and then sent back unchanged by the browser each time it accesses that server. HTTP cookies are used for authenticating , tracking, and maintaining specific information about users, such as site preferences and the contents of their electronic shopping carts . The term &quot;cookie&quot; is derived from &quot; magic cookie ,&quot; a well-known concept in unix computing which inspired both the idea and the name of HTTP cookies.
  • 28. Session Normally manage by web server Use cookie to help keeping session id or session identifier Session timeout, unused data will be cleared from memory
  • 29. Session Browser Web Server Session ID Cookie Session Data Session Data Session Data Session Data Browser Session ID Cookie
  • 30. Question If we close browser, will the cookie disappear ? Can we change value in cookie manually? How to open web site in a new session Open new browser window?