HTTP and Web Technologies Flashcards
(151 cards)
What is HTTP?
Hyper Text Transfer Protocol (HTTP) is an application layer protocol which allows for data communication for World Wide Web.
It defines how messages should be formatted and transmitted and what actions should browsers take in response to various commands.
What is HTTPS?
Hyper Text Transfer Protocol Secure (HTTPS) is the extension of HTTP. It is used for secure communication as it encrypts all message contents, including HTTP headers and request/response data.
In HTTPS, the underlying communication protocol (TCP) is encrypted using TLS (Transport Layer Security).
HTTPS promotes:
- authentication of accessed websites
- protection of privacy and integrity of exchanged data while in transit
and provides protection against:
- man in the middle attack
- eavesdropping
- data tampering
What is client and server?
In terms of networking, client is the entity initiating a request for data/service and server is the entity providing the data/service.
What is a stateless and stateful protocol?
- Stateless protocol is the one in which state of client (session data, identity, status etc) is not stored by server and every request from client is treated as an independent request.
For eg. IP, HTTP - Stateful protocol is the one in which server has to maintain the state of client.
For eg. TCP, BGP
Give examples of stateless protocol.
IP and HTTP
Give examples of stateful protocol.
TCP and BGP
Give the default ports for:
- HTTP
- HTTPS
- echo
- FTP data
- FTP control
- SSH
- SMTP
- DHCP server
- DHCP client
- SQL server
- Telnet
- POP3
- DNS
- 80
- 443
- 7
- 20
- 21
- 22
- 25
- 67
- 68
- 1433
- 23
- 110
- 53
How does server store state when HTTP, the communication protocol, is stateless?
HTTP is layered on top of TCP, the transmission/connection protocol, which itself is stateful.
In addition to this, the server uses cookies, a session management method, to store the state.
What is a port?
IP addresses identify the network but cannot identify the services (SMTP/HTTP/FTP) on that network. TCP/UDP extend the IP addresses by providing the 2-byte address of these services, called port.
What is an HTTP session?
It is the sequence of network request-response transactions for a single client and consists of three phases:
- Client establishes a TCP connection.
- Client sends a request
- Server processes the request, sending back status code and data.
Explain the request-response pair.
The HTTP communication sent by client is termed as request, which contains startline (HTTP verb followed by URI followed by HTTP version), header (acceptable data formats/size/languages), a blank line and optional body.
The HTTP reply by server to the request by client is termed as response, which contains status line (HTTP status code followed by status text followed by HTTP version), header (format/size/langague of data) and optional body.
What is the current version of HTTP and what are its advantages over previous version?
Current version is HTTP/2.
Advantages of HTTP/2 over HTTP/1.1:
- data compression of header
- parallel loading of page elements (image, video, text)
- request prioritization
What is a URL? Explain the structure of URL.
Uniform Resource Locator (URL) is the web address of a web resource specifying its uniform location in computer network.
For a URL
https://www.hellothere.com:1234/catalogue/home?location=sydney&budget=10000
- https:// is the protocol
- www.hellothere.com is the host
- 1234 is the port number
- catalogue/home is resource path
- location=sydney&budget=10000 is the query.
What is a URI? Whats the difference between URI and URL?
Uniform Resource Identifier (URI) is a compact sequence of characters that identify a web resource, but cannot locate it.
URLs can identify and locate a resource and hence are URIs. This makes all URLs URIs but vice versa is not true.
For eg. name of a person is URI as it can identify it but cannot locate it. Address of a person is URL and URI as it can locate and identify it.
What is URN? Whats the difference between URL, URI and URN?
Uniform Resource Name (URN) is used to identify a resource by unique name but not locate it. It is in the form of urn:isbn:n-nn-nnnnnn-n.
URLs identify and locate a resource whereas URNs only identiy the resource by a unique name. Both URLs and URNs are URIs.
What are the HTTP verbs?
The action that a client would like to perfom is termed as HTTP verb.
GET, POST, PUT, DELETE, HEAD, CONNECT, PATCH are some of the verbs.
Explain idempotent methods.
A method is idempotent if multiple requests of that method can be made without changing the result beyond initial application.
GET, PUT, HEAD, PATCH, DELETE are idempotent methods but POST is not.
What is HTTP GET?
It is used to retrieve a resource from server. It can send limited data which is appended to the URL. As this displays the username and password, GET is unsecure. Ex. GET /dept/class HTTP/1.1
What is HTTP POST?
It is used to send data to the server to create new resources through a separate body section. Ex. POST /home/class HTTP/1.1
What is HTTP DELETE?
It is used to delete the data on server.
Ex. DELETE /home/class HTTP/1.1
What is HTTP PUT?
It is used to either entirely replace existing data or create new resource on server.
Ex. PUT /home/class HTTP/1.1
What is HTTP HEAD?
It is used to request headers that are generally sent with GET which can be checked before downloading a large resource.
Ex. HEAD /home/class
What is HTTP PATCH? What is the difference between HTTP PUT and HTTP PATCH?
HTTP PATCH is used to modify portions of already existing data on server. HTTP PUT replaces entire resource with the new data. Ex. PATCH /home/class HTTP/1.1
What is HTTP CONNECT?
Used by client to start two-way communication with requested server only when it knows it talks to proxy and the final URI begins with https://.
CONNECT www.google.com:443 HTTP/1.1
asks proxy to open a raw TCP connection to google and to repeat the data over that connection without any interpretation.
The intent of connect is to allow end-to-end encrypted TLS session, so that the data is unreadable to a proxy.
Once the connection has been established by the server, the Proxy server continues to proxy the TCP stream to and from the client.