SlideShare a Scribd company logo
1 of 13
HTTP REQUEST AND
HTTP RESPONSE
BY
SANA MATEEN
HTTP REQUEST
• HTTP (Hypertext Transfer Protocol) is perhaps the most popular
application protocol used in the Internet (or The WEB).
• HTTP is a stateless protocol. In other words, the current request does
not know what has been done in the previous requests.
• Whenever you issue URL from your browser to get a web resource using
HTTP, the browser turns the URL into a request message and sends it to
the HTTP server. The HTTP server interprets the request message, and
returns you an appropriate response message, which is either the
resource you requested or an error message.
Important header information
Accept This header specifies the MIME types that the browser or other
clients can handle. Values of image/png or image/jpeg are the
two most common possibilities.
Authorization This header is used by clients to identify themselves when
accessing password-protected Web pages.
Content-Length This header is applicable only to POST requests and gives the
size of the POST data in bytes.
Methods to read HTTP Header:
There are following methods which can be used to read HTTP header in your servlet
program. These methods are available with HttpServletRequest object.
Enumeration getHeaderNames()
Returns an enumeration of all the header names this request contains
String getHeader(String name)
Returns the value of the specified request header as a String.
HTTP GET REQUEST
HTTP POST REQUEST
HTTP Request and Response Explained
HTTP Request and Response Explained
HTTP Request and Response Explained
HTTP Request and Response Explained

More Related Content

What's hot (20)

Servlets
ServletsServlets
Servlets
 
Servlet life cycle
Servlet life cycleServlet life cycle
Servlet life cycle
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side Programming
 
Tcpip services and applications
Tcpip services and applicationsTcpip services and applications
Tcpip services and applications
 
Http and its Applications
Http and its ApplicationsHttp and its Applications
Http and its Applications
 
Session tracking in servlets
Session tracking in servletsSession tracking in servlets
Session tracking in servlets
 
Introduction to XHTML
Introduction to XHTMLIntroduction to XHTML
Introduction to XHTML
 
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 
Web servers
Web serversWeb servers
Web servers
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 
Http protocol
Http protocolHttp protocol
Http protocol
 
Web server
Web serverWeb server
Web server
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentation
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Http
HttpHttp
Http
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
 
Sessions in php
Sessions in php Sessions in php
Sessions in php
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Proxy Server
Proxy ServerProxy Server
Proxy Server
 
Html 5 Features And Benefits
Html 5 Features And Benefits  Html 5 Features And Benefits
Html 5 Features And Benefits
 

Viewers also liked

Jsp elements
Jsp elementsJsp elements
Jsp elementsNuha Noor
 
Reading init param
Reading init paramReading init param
Reading init paramNuha Noor
 
Understanding layout managers
Understanding layout managersUnderstanding layout managers
Understanding layout managersNuha Noor
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessionsNuha Noor
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servletsNuha Noor
 
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...Nuha Noor
 

Viewers also liked (13)

Jsp elements
Jsp elementsJsp elements
Jsp elements
 
Reading init param
Reading init paramReading init param
Reading init param
 
Understanding layout managers
Understanding layout managersUnderstanding layout managers
Understanding layout managers
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessions
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servlets
 
Xml dtd
Xml dtdXml dtd
Xml dtd
 
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
 
Xml schema
Xml schemaXml schema
Xml schema
 
Dom parser
Dom parserDom parser
Dom parser
 
Xml dom
Xml domXml dom
Xml dom
 
Events1
Events1Events1
Events1
 
Intro xml
Intro xmlIntro xml
Intro xml
 
Xhtml
XhtmlXhtml
Xhtml
 

Similar to HTTP Request and Response Explained

Similar to HTTP Request and Response Explained (20)

Http_Protocol.pptx
Http_Protocol.pptxHttp_Protocol.pptx
Http_Protocol.pptx
 
http presentation 1.pptx
http presentation 1.pptxhttp presentation 1.pptx
http presentation 1.pptx
 
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptHTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
 
Lecture 6- http
Lecture  6- httpLecture  6- http
Lecture 6- http
 
Starting With Php
Starting With PhpStarting With Php
Starting With Php
 
Hypertex transfer protocol
Hypertex transfer protocolHypertex transfer protocol
Hypertex transfer protocol
 
www and http services
www and http serviceswww and http services
www and http services
 
Web Technologies Notes - TutorialsDuniya.pdf
Web Technologies Notes - TutorialsDuniya.pdfWeb Technologies Notes - TutorialsDuniya.pdf
Web Technologies Notes - TutorialsDuniya.pdf
 
Web Technologies Notes - TutorialsDuniya.pdf
Web Technologies Notes - TutorialsDuniya.pdfWeb Technologies Notes - TutorialsDuniya.pdf
Web Technologies Notes - TutorialsDuniya.pdf
 
Webbasics
WebbasicsWebbasics
Webbasics
 
Compute rNetwork.pptx
Compute rNetwork.pptxCompute rNetwork.pptx
Compute rNetwork.pptx
 
Browser
BrowserBrowser
Browser
 
HTTP
HTTPHTTP
HTTP
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3
 
WWW & HTTP
WWW & HTTPWWW & HTTP
WWW & HTTP
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
 

Recently uploaded

Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 

Recently uploaded (20)

Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 

HTTP Request and Response Explained

  • 1. HTTP REQUEST AND HTTP RESPONSE BY SANA MATEEN
  • 2. HTTP REQUEST • HTTP (Hypertext Transfer Protocol) is perhaps the most popular application protocol used in the Internet (or The WEB). • HTTP is a stateless protocol. In other words, the current request does not know what has been done in the previous requests. • Whenever you issue URL from your browser to get a web resource using HTTP, the browser turns the URL into a request message and sends it to the HTTP server. The HTTP server interprets the request message, and returns you an appropriate response message, which is either the resource you requested or an error message.
  • 3. Important header information Accept This header specifies the MIME types that the browser or other clients can handle. Values of image/png or image/jpeg are the two most common possibilities. Authorization This header is used by clients to identify themselves when accessing password-protected Web pages. Content-Length This header is applicable only to POST requests and gives the size of the POST data in bytes. Methods to read HTTP Header: There are following methods which can be used to read HTTP header in your servlet program. These methods are available with HttpServletRequest object. Enumeration getHeaderNames() Returns an enumeration of all the header names this request contains String getHeader(String name) Returns the value of the specified request header as a String.
  • 4.
  • 5.
  • 7.
  • 8.