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

Apache web server
Apache web serverApache web server
Apache web serverSabiha M
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocolselvakumar_b1985
 
IT2255 Web Essentials - Unit II Web Designing
IT2255 Web Essentials - Unit II  Web DesigningIT2255 Web Essentials - Unit II  Web Designing
IT2255 Web Essentials - Unit II Web Designingpkaviya
 
02 protocol architecture
02 protocol architecture02 protocol architecture
02 protocol architectureOrbay Yeşil
 
Basic tags in html
Basic tags in htmlBasic tags in html
Basic tags in htmlRita Gokani
 
Web ,app and db server presentation
Web ,app and db server presentationWeb ,app and db server presentation
Web ,app and db server presentationParth Godhani
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)Computer_ at_home
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbookWave Digitech
 
Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8Katy Slemon
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http responseNuha Noor
 
Batch file programming
Batch file programmingBatch file programming
Batch file programmingswapnil kapate
 

Mais procurados (20)

HTTP
HTTPHTTP
HTTP
 
Apache web server
Apache web serverApache web server
Apache web server
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
Web technology
Web technologyWeb technology
Web technology
 
IT2255 Web Essentials - Unit II Web Designing
IT2255 Web Essentials - Unit II  Web DesigningIT2255 Web Essentials - Unit II  Web Designing
IT2255 Web Essentials - Unit II Web Designing
 
02 protocol architecture
02 protocol architecture02 protocol architecture
02 protocol architecture
 
Basic tags in html
Basic tags in htmlBasic tags in html
Basic tags in html
 
Web ,app and db server presentation
Web ,app and db server presentationWeb ,app and db server presentation
Web ,app and db server presentation
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
Files and folders
Files and foldersFiles and folders
Files and folders
 
HTTPS
HTTPSHTTPS
HTTPS
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http response
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Http
HttpHttp
Http
 
HTTP & WWW
HTTP & WWWHTTP & WWW
HTTP & WWW
 
Batch file programming
Batch file programmingBatch file programming
Batch file programming
 
Http Vs Https .
Http Vs Https . Http Vs Https .
Http Vs Https .
 
HTTPS
HTTPSHTTPS
HTTPS
 

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
 
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 2014Navaneethan Naveen
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
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
 
Web Server Technologies I: HTTP
Web Server Technologies I: HTTP Web Server Technologies I: HTTP
Web Server Technologies I: HTTP webhostingguy
 
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
 
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
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
web_01_HTTP.ppt
web_01_HTTP.pptweb_01_HTTP.ppt
web_01_HTTP.ppt
 
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
 
Web Server Technologies I: HTTP
Web Server Technologies I: HTTP Web Server Technologies I: HTTP
Web Server Technologies I: HTTP
 
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

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

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