SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Web Interaction: HTTP




        Hypertext Transfer Protocol
Client Server Architecture
Request Response Model

                         Request

        Client                             Server

 ●   Needs services                 ● Contains the service
 (data) from another                ●Waits    for    client
 node (the server)                  requests
 ●Sends requests                    ●Sends Responses

 ●Waits for responses

 ●Usually contains the

 UI

                         Response
Client – Server Apps in Web




●   Client: User Agent a.k.a. The Web Browser
    ● The first Web Browser created by Tim Berners-

      Lee (WorldWideWeb)
    ● The software we use to surf the web.
Client-Server Apps in Web


●   Server: The Web Server
    ● Also known as HTTP Server.

    ● Server that hosts web content.

    ● Most web servers can be configured to handle

      dynamic content
      ● Usually, 'attach' a programming language and

        related tools to the server and you're ready to do
        web programming.
Browser – Server Interaction

●   PROTOCOL
    ● System of that two or more communicating parties

      follow when they 'talk' with each other.
    ● For Web: HTTP, Hypertext Transfer Protocol

    ● When Accessing a web page, the browser makes

      an HTTP Request (message) and sends to the
      server.
    ● Server creates one or more HTTP Responses as a

      response to request.
    ● HTTP is a “text-based” protocol.
The HTTP Request
When does a browser makes a request?
● When user types a URL on the address bar of

  the browser.
The HTTP Request
When does a browser makes a request?
● When   additional resources are linked to a
  resource.
The HTTP Request
When does a browser makes a request?
● When the user clicks on a hyperlink (and the

  hyperlink refers to a Web Resource).
The HTTP Request
When does a browser makes a request?
● As a response to a request redirect.
The HTTP Request
When does a browser makes a request?
● User Submits a Web Form.
The HTTP Request

●   HTTP Request
    ● The message that browsers send to web servers.

    ● Contains information about the request, kind of

      request, where the request comes from, type of
      browser used, etc...
    Request       = Request-Line
                    *(( general-header
                       | request-header
                       | entity-header ) CRLF)
                    CRLF
                    [ message-body ]
Parts of the Request



●   Request Line
    ● The First Line of the Request

    ● It tells us what kind of HTTP Request it is (Method)

    ● The URI (resource) being requested

    ● Protocol Version.


    Request-Line= Method SP Request-URI SP HTTP-Version CRLF
Parts of the Request Line : Kinds of
Requests

  Method   = "OPTIONS"
           | "GET"
           | "HEAD"
           | "POST"
           | "PUT"
            | "DELETE"
            | "TRACE"
            | "CONNECT"
            | extension-method


extension-method = token
Kinds of Requests
●   OPTIONS - Request for information about
    communication options available at the service
    provider (server) and/or options regarding a
    resource.
●   GET – retrieve whatever information is identified
    by the Request-URI.
●   HEAD – identical to GET but only gets
    metainformation about the request.
●   POST – covers different functions
      ●   Annotation of existing resources
      ●   “posting” a message
      ●   Providing data for a data handling process
      ●   Extending a database
Kinds of Requests

●   PUT – store supplied entity at the server under
    supplied URI
●   DELETE – removes resource identified by
    request-URI
●   TRACE – remote, application-layer loop back of
    the message (for debugging)
●   CONNECT – for use with a proxy.
Parts of the Request Line: Request
URI & HTTP Version


● Request-URI: URI of the resource, may be relative*
  or absolute
● HTTP Version

  ● HTTP/0.9

  ● HTTP/1.0

  ● HTTP/1.1
Examples


GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1


OPTIONS * HTTP/1.1


DELETE /pub/WWW/TheProject.html HTTP/1.1
Host: www.w3.org

TRACE * HTTP/1.1
Headers

● From the second line up to the empty line before the
  message body are called headers
● Three types of headers

  ● General Headers: Common headers also used in

    responses, e.g. Date, Host, etc..
  ● Request Headers: Information about the Client

  ● Entity Headers: Information about the content of

    the request message body (e.g. When transferring
    files via upload).

    Header-Name: Value CRLF
General Headers


    general-header = Cache-Control
                    | Connection
                    | Date
                    | Pragma
                    | Trailer
                    | Transfer-Encoding
                    | Upgrade
                    | Via
                    | Warning
Request Headers
   request-header =   Accept
                  |   Accept-Charset
                  |   Accept-Encoding
                  |   Accept-Language
                  |   Authorization
                  |   Expect
                  |   From
                  |   Host
                  |   If-Match
                  |   If-Modified-Since
                  |   If-None-Match
                  |   If-Range
                  |   If-Unmodified-Since
                  |   Max-Forwards
                  |   Proxy-Authorization
                  |   Range
                  |   Referer
                  |   TE
                  |   User-Agent
Entity Headers

     entity-header   =   Allow
                     |   Content-Encoding
                     |   Content-Language
                     |   Content-Length
                     |   Content-Location
                     |   Content-MD5
                     |   Content-Range
                     |   Content-Type
                     |   Expires
                     |   Last-Modified
                     |   extension-header

     extension-header = message-header
Message Body
●   Message Body = Entity Body encoded as per
    Encoding specified by entity headers.
    ● Instances when there is a message body:

      ● When submitting a POST request (i.e. form data

        is encoded in the body).
      ● When submitting a form with a file attachment

        (i.e. file upload).
Example


GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/
    jpeg, image/pjpeg, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE
    5.01; Windows NT)
Host: hypothetical.ora.com
Connection: Keep-Alive
HTTP Response

● Also a text encoded message from web server to
  browser.
● One   request may trigger multiple responses
  depending on size of response.

         Response      = Status-Line
                       *(( general-header
                        | response-header
                        | entity-header ) CRLF)
                       CRLF
                       [ message-body ]
Parts of HTTP Response: Status-
     Line


●   Status line tells us
    ● HTTP Version

    ● The Status Code and Phrase, which tells us if the

      request was successfully processed (or not)
    Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
Status Code and Reason Phrase



● Status Code: A 3-digit number corresponding to a
  response type.
● Reason Phrase:   Describes the response or result of
  processing the request.
● Status  Codes grouped according to kind of
  response, grouping determined by the first digit.
Status Code and Reason Phrase
Status Codes

 - 1xx: Informational - Request received, continuing process

 - 2xx: Success - The action was successfully received,
   understood, and accepted

 - 3xx: Redirection - Further action must be taken in order to
   complete the request

 - 4xx: Client Error - The request contains bad syntax or cannot
   be fulfilled

 - 5xx: Server Error - The server failed to fulfill an apparently
   valid request
Assignment:




                MEMORIZE
                  41 or so
   Status Codes and Corresponding Phrases
Response Header


●   Contains information about the server.
         response-header =   Accept-Ranges
                         |   Age
                         |   ETag
                         |   Location
                         |   Proxy-Authenticate
                         |   Retry-After
                         |   Server
                         |   Vary
                         |   WWW-Authenticate
Response Example
HTTP/1.1 200 OK
Date: Mon, 06 Dec 1999 20:54:26 GMT
Server: Apache/1.3.6 (Unix)
Last-Modified: Fri, 04 Oct 1996 14:06:11 GMT
ETag: "2f5cd-964-381e1bd6"
Accept-Ranges: bytes
Content-length: 327
Connection: close
Content-type: text/html

<title>Sample Homepage</title>
<img src="/images/oreilly_mast.gif">
<h1>Welcome</h2>
Hi there, this is a simple web page. Granted, it may not
be as elegant as some other web pages you've seen on the net,
  but there are
some common qualities:

<ul>
  <li> An image,
  <li> Text,
  <li> and a <a href="/example2.html"> hyperlink. </a>
</ul>
HTTP Communication

Weitere ähnliche Inhalte

Was ist angesagt? (20)

HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response Structure
 
HTTP
HTTPHTTP
HTTP
 
Web servers – features, installation and configuration
Web servers – features, installation and configurationWeb servers – features, installation and configuration
Web servers – features, installation and configuration
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 
Http-protocol
Http-protocolHttp-protocol
Http-protocol
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side Programming
 
Basics of the Web Platform
Basics of the Web PlatformBasics of the Web Platform
Basics of the Web Platform
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Http
HttpHttp
Http
 
Web api
Web apiWeb api
Web api
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Http Introduction
Http IntroductionHttp Introduction
Http Introduction
 
web server
web serverweb server
web server
 
Http and its Applications
Http and its ApplicationsHttp and its Applications
Http and its Applications
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 

Ähnlich wie HTTP

REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web ServiceHoan Vu Tran
 
Restful web services with java
Restful web services with javaRestful web services with java
Restful web services with javaVinay Gopinath
 
RESTful web services using java and spring
RESTful web services using java and springRESTful web services using java and spring
RESTful web services using java and springMuhammad Junaid Ansari
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
Hypertex transfer protocol
Hypertex transfer protocolHypertex transfer protocol
Hypertex transfer protocolwanangwa234
 
Module 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxModule 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxAASTHAJAJOO
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
Httpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-convertedHttpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-convertedcomputerorganization
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.pptweb-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt20521742
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.pptkstalin2
 

Ähnlich wie HTTP (20)

Web technologies: HTTP
Web technologies: HTTPWeb technologies: HTTP
Web technologies: HTTP
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
IP UNIT 1.pptx
IP UNIT 1.pptxIP UNIT 1.pptx
IP UNIT 1.pptx
 
Restful web services with java
Restful web services with javaRestful web services with java
Restful web services with java
 
RESTful web services using java and spring
RESTful web services using java and springRESTful web services using java and spring
RESTful web services using java and spring
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Browser
BrowserBrowser
Browser
 
Web & HTTP
Web & HTTPWeb & HTTP
Web & HTTP
 
Hypertex transfer protocol
Hypertex transfer protocolHypertex transfer protocol
Hypertex transfer protocol
 
Module 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxModule 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptx
 
Introduction to HTTP
Introduction to HTTPIntroduction to HTTP
Introduction to HTTP
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Httpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-convertedHttpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-converted
 
Ch-1_.ppt
Ch-1_.pptCh-1_.ppt
Ch-1_.ppt
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.pptweb-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
 
Http protocol
Http protocolHttp protocol
Http protocol
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 

Mehr von MaeEstherMaguadMaralit (15)

Chapter2c
Chapter2cChapter2c
Chapter2c
 
Chapter2b
Chapter2bChapter2b
Chapter2b
 
Chapter2a
Chapter2aChapter2a
Chapter2a
 
Chapter1c
Chapter1cChapter1c
Chapter1c
 
Chapter1b
Chapter1bChapter1b
Chapter1b
 
Chapter1a
Chapter1aChapter1a
Chapter1a
 
Chapter2d
Chapter2dChapter2d
Chapter2d
 
linked list (CMSC 123)
linked list (CMSC 123)linked list (CMSC 123)
linked list (CMSC 123)
 
The lovedare
The lovedareThe lovedare
The lovedare
 
Cmsc 100 (web content)
Cmsc 100  (web content)Cmsc 100  (web content)
Cmsc 100 (web content)
 
Cmsc 100 (web forms)
Cmsc 100 (web forms)Cmsc 100 (web forms)
Cmsc 100 (web forms)
 
Cmsc 100 xhtml and css
Cmsc 100 xhtml and cssCmsc 100 xhtml and css
Cmsc 100 xhtml and css
 
Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)
 
Chapter2a
Chapter2aChapter2a
Chapter2a
 
Chapter1b
Chapter1bChapter1b
Chapter1b
 

Kürzlich hochgeladen

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Kürzlich hochgeladen (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

HTTP

  • 1. Web Interaction: HTTP Hypertext Transfer Protocol
  • 2. Client Server Architecture Request Response Model Request Client Server ● Needs services ● Contains the service (data) from another ●Waits for client node (the server) requests ●Sends requests ●Sends Responses ●Waits for responses ●Usually contains the UI Response
  • 3. Client – Server Apps in Web ● Client: User Agent a.k.a. The Web Browser ● The first Web Browser created by Tim Berners- Lee (WorldWideWeb) ● The software we use to surf the web.
  • 4. Client-Server Apps in Web ● Server: The Web Server ● Also known as HTTP Server. ● Server that hosts web content. ● Most web servers can be configured to handle dynamic content ● Usually, 'attach' a programming language and related tools to the server and you're ready to do web programming.
  • 5. Browser – Server Interaction ● PROTOCOL ● System of that two or more communicating parties follow when they 'talk' with each other. ● For Web: HTTP, Hypertext Transfer Protocol ● When Accessing a web page, the browser makes an HTTP Request (message) and sends to the server. ● Server creates one or more HTTP Responses as a response to request. ● HTTP is a “text-based” protocol.
  • 6. The HTTP Request When does a browser makes a request? ● When user types a URL on the address bar of the browser.
  • 7. The HTTP Request When does a browser makes a request? ● When additional resources are linked to a resource.
  • 8. The HTTP Request When does a browser makes a request? ● When the user clicks on a hyperlink (and the hyperlink refers to a Web Resource).
  • 9. The HTTP Request When does a browser makes a request? ● As a response to a request redirect.
  • 10. The HTTP Request When does a browser makes a request? ● User Submits a Web Form.
  • 11. The HTTP Request ● HTTP Request ● The message that browsers send to web servers. ● Contains information about the request, kind of request, where the request comes from, type of browser used, etc... Request = Request-Line *(( general-header | request-header | entity-header ) CRLF) CRLF [ message-body ]
  • 12. Parts of the Request ● Request Line ● The First Line of the Request ● It tells us what kind of HTTP Request it is (Method) ● The URI (resource) being requested ● Protocol Version. Request-Line= Method SP Request-URI SP HTTP-Version CRLF
  • 13. Parts of the Request Line : Kinds of Requests Method = "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE" | "CONNECT" | extension-method extension-method = token
  • 14. Kinds of Requests ● OPTIONS - Request for information about communication options available at the service provider (server) and/or options regarding a resource. ● GET – retrieve whatever information is identified by the Request-URI. ● HEAD – identical to GET but only gets metainformation about the request. ● POST – covers different functions ● Annotation of existing resources ● “posting” a message ● Providing data for a data handling process ● Extending a database
  • 15. Kinds of Requests ● PUT – store supplied entity at the server under supplied URI ● DELETE – removes resource identified by request-URI ● TRACE – remote, application-layer loop back of the message (for debugging) ● CONNECT – for use with a proxy.
  • 16. Parts of the Request Line: Request URI & HTTP Version ● Request-URI: URI of the resource, may be relative* or absolute ● HTTP Version ● HTTP/0.9 ● HTTP/1.0 ● HTTP/1.1
  • 17. Examples GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1 OPTIONS * HTTP/1.1 DELETE /pub/WWW/TheProject.html HTTP/1.1 Host: www.w3.org TRACE * HTTP/1.1
  • 18. Headers ● From the second line up to the empty line before the message body are called headers ● Three types of headers ● General Headers: Common headers also used in responses, e.g. Date, Host, etc.. ● Request Headers: Information about the Client ● Entity Headers: Information about the content of the request message body (e.g. When transferring files via upload). Header-Name: Value CRLF
  • 19. General Headers general-header = Cache-Control | Connection | Date | Pragma | Trailer | Transfer-Encoding | Upgrade | Via | Warning
  • 20. Request Headers request-header = Accept | Accept-Charset | Accept-Encoding | Accept-Language | Authorization | Expect | From | Host | If-Match | If-Modified-Since | If-None-Match | If-Range | If-Unmodified-Since | Max-Forwards | Proxy-Authorization | Range | Referer | TE | User-Agent
  • 21. Entity Headers entity-header = Allow | Content-Encoding | Content-Language | Content-Length | Content-Location | Content-MD5 | Content-Range | Content-Type | Expires | Last-Modified | extension-header extension-header = message-header
  • 22. Message Body ● Message Body = Entity Body encoded as per Encoding specified by entity headers. ● Instances when there is a message body: ● When submitting a POST request (i.e. form data is encoded in the body). ● When submitting a form with a file attachment (i.e. file upload).
  • 23. Example GET / HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/ jpeg, image/pjpeg, */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) Host: hypothetical.ora.com Connection: Keep-Alive
  • 24. HTTP Response ● Also a text encoded message from web server to browser. ● One request may trigger multiple responses depending on size of response. Response = Status-Line *(( general-header | response-header | entity-header ) CRLF) CRLF [ message-body ]
  • 25. Parts of HTTP Response: Status- Line ● Status line tells us ● HTTP Version ● The Status Code and Phrase, which tells us if the request was successfully processed (or not) Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
  • 26. Status Code and Reason Phrase ● Status Code: A 3-digit number corresponding to a response type. ● Reason Phrase: Describes the response or result of processing the request. ● Status Codes grouped according to kind of response, grouping determined by the first digit.
  • 27. Status Code and Reason Phrase
  • 28. Status Codes - 1xx: Informational - Request received, continuing process - 2xx: Success - The action was successfully received, understood, and accepted - 3xx: Redirection - Further action must be taken in order to complete the request - 4xx: Client Error - The request contains bad syntax or cannot be fulfilled - 5xx: Server Error - The server failed to fulfill an apparently valid request
  • 29. Assignment: MEMORIZE 41 or so Status Codes and Corresponding Phrases
  • 30. Response Header ● Contains information about the server. response-header = Accept-Ranges | Age | ETag | Location | Proxy-Authenticate | Retry-After | Server | Vary | WWW-Authenticate
  • 31. Response Example HTTP/1.1 200 OK Date: Mon, 06 Dec 1999 20:54:26 GMT Server: Apache/1.3.6 (Unix) Last-Modified: Fri, 04 Oct 1996 14:06:11 GMT ETag: "2f5cd-964-381e1bd6" Accept-Ranges: bytes Content-length: 327 Connection: close Content-type: text/html <title>Sample Homepage</title> <img src="/images/oreilly_mast.gif"> <h1>Welcome</h2> Hi there, this is a simple web page. Granted, it may not be as elegant as some other web pages you've seen on the net, but there are some common qualities: <ul> <li> An image, <li> Text, <li> and a <a href="/example2.html"> hyperlink. </a> </ul>