SlideShare a Scribd company logo
1 of 32
Download to read offline
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

More Related Content

What's hot

RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response StructureBhagyashreeGajera1
 
Web server architecture
Web server architectureWeb server architecture
Web server architectureTewodros K
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersLemi Orhan Ergin
 
Introduction to Web Hosting.
Introduction to Web Hosting.Introduction to Web Hosting.
Introduction to Web Hosting.Cloudbells.com
 
HTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status CodeHTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status CodeAbhishek L.R
 
Introduction to SAML 2.0
Introduction to SAML 2.0Introduction to SAML 2.0
Introduction to SAML 2.0Mika Koivisto
 
JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch APIXcat Liu
 
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise Users
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise UsersApache Knox Gateway "Single Sign On" expands the reach of the Enterprise Users
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise UsersDataWorks Summit
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first courseVlad Posea
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 

What's hot (20)

RESTful services
RESTful servicesRESTful services
RESTful services
 
Web Design (Tools)
Web Design (Tools)Web Design (Tools)
Web Design (Tools)
 
Web servers
Web serversWeb servers
Web servers
 
WEB HOSTING
WEB HOSTINGWEB HOSTING
WEB HOSTING
 
HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response Structure
 
Http Protocol
Http ProtocolHttp Protocol
Http Protocol
 
Web server architecture
Web server architectureWeb server architecture
Web server architecture
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-Developers
 
Introduction to Web Hosting.
Introduction to Web Hosting.Introduction to Web Hosting.
Introduction to Web Hosting.
 
hosting.ppt
hosting.ppthosting.ppt
hosting.ppt
 
HTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status CodeHTTP Request Header and HTTP Status Code
HTTP Request Header and HTTP Status Code
 
Introduction to SAML 2.0
Introduction to SAML 2.0Introduction to SAML 2.0
Introduction to SAML 2.0
 
JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch API
 
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise Users
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise UsersApache Knox Gateway "Single Sign On" expands the reach of the Enterprise Users
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise Users
 
Web server
Web serverWeb server
Web server
 
Web services SOAP
Web services SOAPWeb services SOAP
Web services SOAP
 
Web api
Web apiWeb api
Web api
 
Javascript validating form
Javascript validating formJavascript validating form
Javascript validating form
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first course
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 

Similar to 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
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.pptkstalin2
 

Similar to 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
 
Http protocol
Http protocolHttp protocol
Http protocol
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
 

More from 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
 

Recently uploaded

JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 

Recently uploaded (20)

JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 

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>