SlideShare uma empresa Scribd logo
1 de 28
WANANGWA L NGWIRA
HYPERTEX TRANSFER PROTOCOL
Introduction--(the web)
 Internet (orTheWeb) is a massive distributed client/server
information system as depicted in the following diagram.
Cont,..
 Many applications are running concurrently over theWeb, such as
web browsing/surfing, e-mail, file transfer, audio & video
streaming, and so on.
 In order for proper communication to take place between the
client and the server, these applications must agree on a specific
application-level protocol such as HTTP, FTP, SMTP, POP, and
etc.
 Many applications are running concurrently over theWeb, such as
web browsing/surfing, e-mail, file transfer, audio & video
streaming, and so on. In order for proper communication to take
place between the client and the server, these applications must
agree on a specific application-level protocol such as HTTP, FTP,
SMTP, POP, and etc.
Cont’
 HTTP is an asymmetric request-response client-server protocol as
illustrated. An HTTP client sends a request message to an
HTTP server.
 information from the server (instead of server pushes
information down to the client).
Browser
 Whenever you issue a URL from your browser to get a web
resource using HTTP, e.g.
http://www.test101.com/index.html, 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.This process
is illustrated below:
Uniform Resource Locator (URL)
 A URL (Uniform Resource Locator) is used to uniquely identify a
resource over the web. URL has the following syntax:
protocol://hostname:port/path-and-file-name
There are 4 parts in a URL:
 Protocol: The application-level protocol used by the client and
server, e.g., HTTP, FTP, and telnet.
 Hostname: The DNS domain name (e.g., www.test101.com) or
IP address (e.g., 192.128.1.2) of the server.
 Port: TheTCP port number that the server is listening for
incoming requests from the clients.
 Path-and-file-name: The name and location of the requested
resource, under the server document base directory.
Cont..’
 For example, in the URL
http://www.test101.com/docs/index.html,
 the communication protocol is HTTP;
 the hostname is www.test101.com.
 The port number was not specified in the URL, and takes
on the default number, which is TCP port 80 for HTTP.
 The path and file name for the resource to be located is
"/docs/index.html".
URL
Other examples of URL are:
 ftp://www.ftp.org/docs/test.txt
 mailto:user@test101.com
 news:soc.culture.Singapore
 telnet://www.test101.com/
HTTP Protocol
 As mentioned, whenever you enter a URL in the address box of the browser,
the browser translates the URL into a request message according to the
specified protocol; and sends the request message to the server.
 For example, the browser translated the URL
http://www.test101.com/doc/index.html into the following request message:
GET /docs/index.html HTTP/1.1
Host: www.test101.com
Accept: image/gif, image/jpeg, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)
(blank line)
Cont,..’
When this request message reaches the server, the server can
take either one of these actions:
 The server interprets the request received, maps the request
into a file under the server's document directory, and returns
the file requested to the client.
 The server interprets the request received, maps the request
into a program kept in the server, executes the program, and
returns the output of the program to the client.
 The request cannot be satisfied, the server returns an error
message.
An example of the HTTP response message is as shown:
HTTP/1.1 200 OK
Date: Sun, 18 Oct 2009 08:56:53 GMT
Server:Apache/2.2.14 (Win32)
Last-Modified: Sat, 20 Nov 2004 07:16:26 GMT
ETag: "10000000565a5-2c-3e94b66c2e680"
Accept-Ranges: bytes
Content-Length: 44
Connection: close
Content-Type: text/html
X-Pad: avoid browser bug
 After that the browser receives the response message,
interprets the message and displays the contents of the
message on the browser's window according to the media
type of the response (as in the Content-Type response
header). Common media type include "text/plain",
"text/html", "image/gif", "image/jpeg", "audio/mpeg",
"video/mpeg", "application/msword", and
"application/pdf".
HTTP VERSION/ Specifications
 There are currently two versions of HTTP, namely,
HTTP/1.0 and HTTP/1.1.
 In HTTP/1.0 a separate connection to the same server is
made for every resource request
 can reuse a connection multiple times to download images,
scripts, style sheets et cetera after the page has been delivered.
HTTP/1.1 communications therefore experience less
latency as the establishment ofTCP connections presents
considerable overhead.
HTTP Request and Response Messages
 HTTP client and server communicate by sending text
messages.The client sends a request message to the server. The
server, in turn, returns a response message.
 An HTTP message consists of a message header and an optional
message body, separated by a blank line, as illustrated below:
HTTP Request Message
 The format of an HTTP request message is as follow:
HTTP request message
Request Line
 The first line of the header is called the request line, followed by optional request headers.
The request line has the following syntax:
request-method-name request-URI HTTP-version
 request-method-name: HTTP protocol defines a set of request methods, e.g., GET, POST, HEAD,
and OPTIONS.The client can use one of these methods to send a request to the server.
 request-URI: specifies the resource requested.
 HTTP-version: Two versions are currently in use: HTTP/1.0 and HTTP/1.1.
 Examples of request line are:
 GET /test.html HTTP/1.1
 HEAD /query.html HTTP/1.0
 POST /index.html HTTP/1.1
Example
 The following shows a sample HTTP request message:
HTTP Response Message
 The format of the HTTP response message is as follows:
HTTP Response Message,. cont,..’
Status Line
 The first line is called the status line, followed by optional response header(s).
The status line has the following syntax:
 HTTP-version status-code reason-phrase
 HTTP-version: The HTTP version used in this session. Either HTTP/1.0 and HTTP/1.1.
 status-code: a 3-digit number generated by the server to reflect the outcome of the request.
 reason-phrase: gives a short explanation to the status code.
 Common status code and reason phrase are "200 OK", "404 Not Found", "403 Forbidden",
"500 Internal Server Error".
Examples of status line are:
 HTTP/1.1 200 OK
 HTTP/1.0 404 Not Found
 HTTP/1.1 403 Forbidden
HTTP Response Message,. cont,..’
Response Headers
 The response headers are in the form name:value pairs:
response-header-name: response-header-value1, response-header-value2, ...
Examples of response headers are:
 Content-Type: text/html
 Content-Length: 35
 Connection: Keep-Alive
 Keep-Alive: timeout=15, max=100
 The response message body contains the resource data requested.
Example
 The following shows a sample response message:
HTTP Response Message,. cont,..’
HTTP Request Methods
HTTP Request Methods
 HTTP protocol defines a set of request methods.A client can use one of these request methods to
send a request message to an HTTP server.The methods are:
 GET:A client can use the GET request to get a web resource from the server.
 HEAD: A client can use the HEAD request to get the header that a GET request would have
obtained. Since the header contains the last-modified date of the data, this can be used to check
against the local cache copy.
 POST: Used to post data up to the web server.
 PUT: Ask the server to store the data.
 DELETE:Ask the server to delete the data.
 TRACE: Ask the server to return a diagnostic trace of the actions it takes.
 OPTIONS: Ask the server to return the list of request methods it supports.
 CONNECT: Used to tell a proxy to make a connection to another host and simply reply the
content, without attempting to parse or cache it.This is often used to make SSL connection through
the proxy.
 Other extension methods.
HTTP Request Methods ,.........cont ‘
"GET" Request Method
 GET is the most common HTTP request method.A client
can use the GET request method to request (or "get") for a
piece of resource from an HTTP server.A GET request
message takes the following syntax:
 GET request-URI HTTP-version
 (optional request headers)
 (blank line)
 (optional request body)
HTTP Request Methods ,.........cont ‘
 The keyword GET is case sensitive and must be in uppercase.
 request-URI: specifies the path of resource requested, which must
begin from the root "/" of the document base directory.
 HTTP-version: Either HTTP/1.0 or HTTP/1.1.This client negotiates
the protocol to be used for the current session. For example, the client
may request to use HTTP/1.1. If the server does not support
HTTP/1.1, it may inform the client in the response to use HTTP/1.0.
 The client uses the optional request headers (such as Accept,Accept-
Language, and etc) to negotiate with the server and ask the server to
deliver the preferred contents (e.g., in the language that the client
preferred).
 GET request message has an optional request body which contains the
query string (to be explained later).
Testing HTTP Requests
Testing HTTP Requests
 There are many way to test out the HTTP requests.Your can use utility program such as
"telnet" or "hyperterm" (search for "telnet.exe" or "hypertrm.exe" under
c:windows), or write you own network program to send raw request message to an
HTTP server to test out the various HTTP requests.
Telnet
"Telnet" is a very useful networking utility. You can use telnet to establish aTCP connection
with a server; and issue raw HTTP requests. For example, suppose that you have started
your HTTP server in the localhost (IP address 127.0.0.1) at port 8000:
 > telnet
 telnet> help
 ... telnet help menu ...
 telnet> open 127.0.0.1 8000
 ConnectingTo 127.0.0.1...
 GET /index.html HTTP/1.0
 (Hit enter twice to send the terminating blank line ...)
 ... HTTP response message ...
Testing HTTP Requests
 Telnet is a character-based protocol. Each character you enter on
the telnet client will be sent to the server immediately.Therefore,
you cannot make typo error in entering you raw command, as
delete and backspace will be sent to the server.You may have to
enable "local echo" option to see the characters you enter. Check
the telnet manual (searchWindows' help) for details on using
telnet.
Network Program
 You could also write your own network program to issue raw
HTTP request to an HTTP server. You network program shall
first establish aTCP/IP connection with the server. Once theTCP
connection is established, you can issue the raw request.
Testing HTTP Requests,...cont’’
 An example of network program written in Java is as shown
(assuming that the HTTP server is running on the localhost (IP
address 127.0.0.1) at port 8000):
import java.net.*;
import java.io.*;
public class HttpClient {
public static void main(String[] args) throws IOException {
//The host and port to be connected.
String host = "127.0.0.1";
int port = 8000;
// Create a

Mais conteúdo relacionado

Mais procurados (20)

Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
Http Protocol
Http ProtocolHttp Protocol
Http Protocol
 
Http
HttpHttp
Http
 
HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response Structure
 
Http
HttpHttp
Http
 
Web and http computer network
Web and http computer networkWeb and http computer network
Web and http computer network
 
transport layer
transport layertransport layer
transport layer
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
Internetworking devices
Internetworking devicesInternetworking devices
Internetworking devices
 
Email
EmailEmail
Email
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
HTTP
HTTPHTTP
HTTP
 
Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014
 
Application Layer and Protocols
Application Layer and ProtocolsApplication Layer and Protocols
Application Layer and Protocols
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side Programming
 
Module 1-Application Layer
Module 1-Application Layer Module 1-Application Layer
Module 1-Application Layer
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
SMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer ProtocolSMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer Protocol
 
Client side scripting
Client side scriptingClient side scripting
Client side scripting
 

Semelhante a Hypertex transfer protocol

Http request&response session 1 - by Vignesh.N
Http request&response session 1 - by Vignesh.NHttp request&response session 1 - by Vignesh.N
Http request&response session 1 - by Vignesh.NNavaneethan Naveen
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
Web Server Technologies I: HTTP
Web Server Technologies I: HTTP Web Server Technologies I: HTTP
Web Server Technologies I: HTTP webhostingguy
 
Web Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting StartedWeb Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting StartedPort80 Software
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer ProtocolRajan Pandey
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcaRenu Thakur
 
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_3Syed Ariful Islam Emon
 
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptHTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptVietAnhNguyen337355
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 

Semelhante a Hypertex transfer protocol (20)

Http request&response session 1 - by Vignesh.N
Http request&response session 1 - by Vignesh.NHttp request&response session 1 - by Vignesh.N
Http request&response session 1 - by Vignesh.N
 
Application layer
Application layerApplication layer
Application layer
 
Http request&response
Http request&responseHttp request&response
Http request&response
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Http Introduction
Http IntroductionHttp Introduction
Http Introduction
 
web_01_HTTP.ppt
web_01_HTTP.pptweb_01_HTTP.ppt
web_01_HTTP.ppt
 
Web Server Technologies I: HTTP
Web Server Technologies I: HTTP Web Server Technologies I: HTTP
Web Server Technologies I: HTTP
 
Web Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting StartedWeb Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting Started
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mca
 
Starting With Php
Starting With PhpStarting With Php
Starting With Php
 
http presentation 1.pptx
http presentation 1.pptxhttp presentation 1.pptx
http presentation 1.pptx
 
Http
HttpHttp
Http
 
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
 
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptHTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Http VS. Https
Http VS. HttpsHttp VS. Https
Http VS. Https
 
The HTTP and Web
The HTTP and Web The HTTP and Web
The HTTP and Web
 
Http_Protocol.pptx
Http_Protocol.pptxHttp_Protocol.pptx
Http_Protocol.pptx
 

Último

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 

Último (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 

Hypertex transfer protocol

  • 1. WANANGWA L NGWIRA HYPERTEX TRANSFER PROTOCOL
  • 2. Introduction--(the web)  Internet (orTheWeb) is a massive distributed client/server information system as depicted in the following diagram.
  • 3. Cont,..  Many applications are running concurrently over theWeb, such as web browsing/surfing, e-mail, file transfer, audio & video streaming, and so on.  In order for proper communication to take place between the client and the server, these applications must agree on a specific application-level protocol such as HTTP, FTP, SMTP, POP, and etc.  Many applications are running concurrently over theWeb, such as web browsing/surfing, e-mail, file transfer, audio & video streaming, and so on. In order for proper communication to take place between the client and the server, these applications must agree on a specific application-level protocol such as HTTP, FTP, SMTP, POP, and etc.
  • 4. Cont’  HTTP is an asymmetric request-response client-server protocol as illustrated. An HTTP client sends a request message to an HTTP server.  information from the server (instead of server pushes information down to the client).
  • 5. Browser  Whenever you issue a URL from your browser to get a web resource using HTTP, e.g. http://www.test101.com/index.html, 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.This process is illustrated below:
  • 6.
  • 7. Uniform Resource Locator (URL)  A URL (Uniform Resource Locator) is used to uniquely identify a resource over the web. URL has the following syntax: protocol://hostname:port/path-and-file-name There are 4 parts in a URL:  Protocol: The application-level protocol used by the client and server, e.g., HTTP, FTP, and telnet.  Hostname: The DNS domain name (e.g., www.test101.com) or IP address (e.g., 192.128.1.2) of the server.  Port: TheTCP port number that the server is listening for incoming requests from the clients.  Path-and-file-name: The name and location of the requested resource, under the server document base directory.
  • 8. Cont..’  For example, in the URL http://www.test101.com/docs/index.html,  the communication protocol is HTTP;  the hostname is www.test101.com.  The port number was not specified in the URL, and takes on the default number, which is TCP port 80 for HTTP.  The path and file name for the resource to be located is "/docs/index.html".
  • 9. URL Other examples of URL are:  ftp://www.ftp.org/docs/test.txt  mailto:user@test101.com  news:soc.culture.Singapore  telnet://www.test101.com/
  • 10. HTTP Protocol  As mentioned, whenever you enter a URL in the address box of the browser, the browser translates the URL into a request message according to the specified protocol; and sends the request message to the server.  For example, the browser translated the URL http://www.test101.com/doc/index.html into the following request message: GET /docs/index.html HTTP/1.1 Host: www.test101.com Accept: image/gif, image/jpeg, */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1) (blank line)
  • 11. Cont,..’ When this request message reaches the server, the server can take either one of these actions:  The server interprets the request received, maps the request into a file under the server's document directory, and returns the file requested to the client.  The server interprets the request received, maps the request into a program kept in the server, executes the program, and returns the output of the program to the client.  The request cannot be satisfied, the server returns an error message.
  • 12. An example of the HTTP response message is as shown: HTTP/1.1 200 OK Date: Sun, 18 Oct 2009 08:56:53 GMT Server:Apache/2.2.14 (Win32) Last-Modified: Sat, 20 Nov 2004 07:16:26 GMT ETag: "10000000565a5-2c-3e94b66c2e680" Accept-Ranges: bytes Content-Length: 44 Connection: close Content-Type: text/html X-Pad: avoid browser bug
  • 13.  After that the browser receives the response message, interprets the message and displays the contents of the message on the browser's window according to the media type of the response (as in the Content-Type response header). Common media type include "text/plain", "text/html", "image/gif", "image/jpeg", "audio/mpeg", "video/mpeg", "application/msword", and "application/pdf".
  • 14. HTTP VERSION/ Specifications  There are currently two versions of HTTP, namely, HTTP/1.0 and HTTP/1.1.  In HTTP/1.0 a separate connection to the same server is made for every resource request  can reuse a connection multiple times to download images, scripts, style sheets et cetera after the page has been delivered. HTTP/1.1 communications therefore experience less latency as the establishment ofTCP connections presents considerable overhead.
  • 15. HTTP Request and Response Messages  HTTP client and server communicate by sending text messages.The client sends a request message to the server. The server, in turn, returns a response message.  An HTTP message consists of a message header and an optional message body, separated by a blank line, as illustrated below:
  • 16. HTTP Request Message  The format of an HTTP request message is as follow:
  • 17. HTTP request message Request Line  The first line of the header is called the request line, followed by optional request headers. The request line has the following syntax: request-method-name request-URI HTTP-version  request-method-name: HTTP protocol defines a set of request methods, e.g., GET, POST, HEAD, and OPTIONS.The client can use one of these methods to send a request to the server.  request-URI: specifies the resource requested.  HTTP-version: Two versions are currently in use: HTTP/1.0 and HTTP/1.1.  Examples of request line are:  GET /test.html HTTP/1.1  HEAD /query.html HTTP/1.0  POST /index.html HTTP/1.1
  • 18. Example  The following shows a sample HTTP request message:
  • 19. HTTP Response Message  The format of the HTTP response message is as follows:
  • 20. HTTP Response Message,. cont,..’ Status Line  The first line is called the status line, followed by optional response header(s). The status line has the following syntax:  HTTP-version status-code reason-phrase  HTTP-version: The HTTP version used in this session. Either HTTP/1.0 and HTTP/1.1.  status-code: a 3-digit number generated by the server to reflect the outcome of the request.  reason-phrase: gives a short explanation to the status code.  Common status code and reason phrase are "200 OK", "404 Not Found", "403 Forbidden", "500 Internal Server Error". Examples of status line are:  HTTP/1.1 200 OK  HTTP/1.0 404 Not Found  HTTP/1.1 403 Forbidden
  • 21. HTTP Response Message,. cont,..’ Response Headers  The response headers are in the form name:value pairs: response-header-name: response-header-value1, response-header-value2, ... Examples of response headers are:  Content-Type: text/html  Content-Length: 35  Connection: Keep-Alive  Keep-Alive: timeout=15, max=100  The response message body contains the resource data requested. Example  The following shows a sample response message:
  • 23. HTTP Request Methods HTTP Request Methods  HTTP protocol defines a set of request methods.A client can use one of these request methods to send a request message to an HTTP server.The methods are:  GET:A client can use the GET request to get a web resource from the server.  HEAD: A client can use the HEAD request to get the header that a GET request would have obtained. Since the header contains the last-modified date of the data, this can be used to check against the local cache copy.  POST: Used to post data up to the web server.  PUT: Ask the server to store the data.  DELETE:Ask the server to delete the data.  TRACE: Ask the server to return a diagnostic trace of the actions it takes.  OPTIONS: Ask the server to return the list of request methods it supports.  CONNECT: Used to tell a proxy to make a connection to another host and simply reply the content, without attempting to parse or cache it.This is often used to make SSL connection through the proxy.  Other extension methods.
  • 24. HTTP Request Methods ,.........cont ‘ "GET" Request Method  GET is the most common HTTP request method.A client can use the GET request method to request (or "get") for a piece of resource from an HTTP server.A GET request message takes the following syntax:  GET request-URI HTTP-version  (optional request headers)  (blank line)  (optional request body)
  • 25. HTTP Request Methods ,.........cont ‘  The keyword GET is case sensitive and must be in uppercase.  request-URI: specifies the path of resource requested, which must begin from the root "/" of the document base directory.  HTTP-version: Either HTTP/1.0 or HTTP/1.1.This client negotiates the protocol to be used for the current session. For example, the client may request to use HTTP/1.1. If the server does not support HTTP/1.1, it may inform the client in the response to use HTTP/1.0.  The client uses the optional request headers (such as Accept,Accept- Language, and etc) to negotiate with the server and ask the server to deliver the preferred contents (e.g., in the language that the client preferred).  GET request message has an optional request body which contains the query string (to be explained later).
  • 26. Testing HTTP Requests Testing HTTP Requests  There are many way to test out the HTTP requests.Your can use utility program such as "telnet" or "hyperterm" (search for "telnet.exe" or "hypertrm.exe" under c:windows), or write you own network program to send raw request message to an HTTP server to test out the various HTTP requests. Telnet "Telnet" is a very useful networking utility. You can use telnet to establish aTCP connection with a server; and issue raw HTTP requests. For example, suppose that you have started your HTTP server in the localhost (IP address 127.0.0.1) at port 8000:  > telnet  telnet> help  ... telnet help menu ...  telnet> open 127.0.0.1 8000  ConnectingTo 127.0.0.1...  GET /index.html HTTP/1.0  (Hit enter twice to send the terminating blank line ...)  ... HTTP response message ...
  • 27. Testing HTTP Requests  Telnet is a character-based protocol. Each character you enter on the telnet client will be sent to the server immediately.Therefore, you cannot make typo error in entering you raw command, as delete and backspace will be sent to the server.You may have to enable "local echo" option to see the characters you enter. Check the telnet manual (searchWindows' help) for details on using telnet. Network Program  You could also write your own network program to issue raw HTTP request to an HTTP server. You network program shall first establish aTCP/IP connection with the server. Once theTCP connection is established, you can issue the raw request.
  • 28. Testing HTTP Requests,...cont’’  An example of network program written in Java is as shown (assuming that the HTTP server is running on the localhost (IP address 127.0.0.1) at port 8000): import java.net.*; import java.io.*; public class HttpClient { public static void main(String[] args) throws IOException { //The host and port to be connected. String host = "127.0.0.1"; int port = 8000; // Create a