HTTP
https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
The Internet
Global system of interconnected computer networks that use the Internet protocol suite (TCP/IP)
IP is the part that obtains the address to which data is sent.
TCP is responsible for data delivery once that IP address has been found.
IP (Internet Protocol)
Delivers packets of data across network boundaries
devices have IP Addresses
TCP (Transmission Control Protocol)
connection oriented
establishes a point-to-point connection between exactly two entities in the network
Client - Web Server
-
Client (Browser or other Servers / Devices)
https://www.google.at
→ Domain Name System DNS → 172.217.23.227 → HTTP Request for Web Resource
-
Multiple Layers and Proxies (see traceroute)
Caching, filtering, load balancing... by routers, modems,...
-
Server
HTTP Response with web resource or error
Can be a collection of servers, sharing the load
Resource
HTML files, documents, images, etc. → make up complete document
Concept for nodes in hypertext
A Web page is a hypertext document: parts of displayed text are links to other pages of the Web.
URL
Uniform Resource Locator URL
For identiying resources
Subtype of Uniform Resource Identifier URI
<scheme>://[<user>[:<password>]@]<server>[:<port>]/[<path>][?<query>][#<fragment>]
https://usr:pwd@tennis-club-wieden.at:3000/members/rackets?year=2020#vintage
scheme http(s), ftp, mongodb,...
user,pwd optional
server domain name / IP address
port at which server is listening
query parameters passed to server
fragment only used by clients to name part of the resource
Host Name vs. Domain Name
hostName.subdomainName.domainName.com
The host name would consist of either "www" where the global internet is the host, or some proprietary network name that represents the host – for example, if the school uses a custom internal network called "myAUnet" then "myAUnet" would be the host name.
HTTP
Hyper Text Transfer Protocol HTTP
Synchronous request-response protocol
Builds upon TCP
Stateless (each request-response pair is independent, no permanent connection between server and browser → allows for a high number of users per server)
HTTPS
Uses TLS connection (Transport Layer Security) - encrypts data
HTTP request
Before any request a TCP connection is established.
Type / method
OPTIONS, TRACE, HEAD, CONNECT access to the metadata of the servers, the Internet connection, the resource, etc.
POST Create
GET Read
PUT Update / Replace
PATCH Update / Modify
DELETE Delete
Side effects
Have some: POST, PUT, PATCH DELETE
Have none: GET
Same effect even with multiple executions: PUT, DELETE
application metadata
Preferred data type and language
request metadata
Application data / message body
sent by some methods
about the sent / recieved data type in the header
HTTP response
Followed by request.
status code
1xx Informational
2xx Success
3xx Redirected
4xx Client Error
5xx Server Error
application data / body
application metadata
Data type, encoding of body ("content-type")
Caching, expiring date ("expires")
Current URL of the resource and last modified ("last modified")
Cookies ("set-cookie")
response metadata
Server, TCP connection state, date