031.3 HTTP Basics Flashcards

1
Q

Defines how a client asks the server for a specific resource and is the set of rules that define how the client application should format
request messages that will be sent to the server.

A

HypterText Transfer Protocol (HTTP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

the client creates a request message identifying the
resource it needs and forwards that message to the server via the network.

A

HTTP Request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

server evaluates where to extract the requested resource and sends a response message back to
the client. The reply message contains details about the requested resource, followed by the
resource itself

A

HTTP Response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Follows HTTP rules to interpret the request and format reply messages.

A

Server (serves requests - duh)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The part of the message that defines the resource details and other context information

A

Header

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The part following the header that contains the content of the corresponding resource is called the

Both request messages and response messages can have these but in most cases only the response message has one.

A

payload

of the message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The first stage of an HTTP data exchange between the client and the server is initiated by this entity when it writes a request message to the server.

A

client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

encrypted version of HTTP

A

The protocol: HyperText Transfer Protocol Secure (https)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

s an address that points to a resource on the
Internet. This resource is usually a file that can be copied from a remote server, but
URLs can also indicate dynamically generated content and data streams.

A

A Uniform Resource Locator (URL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Before contacting the server, the client needs to convert learning.lpi.org to its corresponding
IP address. The client uses another Internet service to request the IP address of a host name from one or more of these - that are automatically defined by the Internet Service Provider, ISP

A

The Domain Name System (DNS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The client tries to connect to the HTTP or HTTPS port with server’s

A

IP address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Identified by numbers and intertwine and identify distinct communication channels within a client/server connection.

A

Transmission Control Protocol (TCP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Port 80

A

HTTP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Port 443

A

HTTPS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

For audio and video protocols used by web applications to implement audio and video calls and is a lower level protocol that is more efficient than HTTP for transferring data streams in both directions.

A

WebSockets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The encrypted connection is established between client and server even before
any HTTP message is exchanged, using

A

TLS
Transport Layer Security

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Interpreted by the server as the location or path for the resource being requested

A

/en/
english

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

defines what operation the client wants to perform on the server

A

HTTP method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

This method informs the server that the client requests the resource

A

GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Most recent version of HTTP protocol wherby messages are encoded in a binary structure whereas message encoded in HTTP/1 are sent in plain text

A

HTTP/2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

May appear redundant because the server’s host has obviously been identified by the client in order to establish the connection and its reasonable to assume that the server knows its identity

A

Host header field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

it is important to inform the host of the expected host name in the request header because it is common practice to use the same HTTP server to host more than one website

A

Virtual Host

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Header field contains details about the client program making the request and this field can be used by the server to adapt the response to the needs of a specific client but is more often used to produce statistics about the clients using the server

A

User-Agent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Of more immediate value because it informs the server about the format for the requested resource and this resource can specify / as the format

A

Accept field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Field that indicates the size in bytes of the payload

A

Content-Length

26
Q

Field that indicates the format of the payload

A

Content-Type

27
Q

One of the most commonly used in traditional HTML forms that use the POST method and each field inserted in the request’s payload is separated by the code indicated by the boundary keyword

A

multipart/form-data

28
Q

Method should only be used when appropriate as it uses a slightly larger amount of data than an equivalent request made with the GET method

A

POST method

29
Q

method sends the parameters
directly in the request’s message header, the total data exchange has a lower latency, because an
additional connection stage to transmit the message body will not be necessary

A

GET method

30
Q

The request was received, continuing to process

A

1xx(Informational)

31
Q

The request was successfully received, understood and accepted

A

2xx(Successful)

32
Q

Further action needs to be taken in order to complete the request

A

3xx(Redirection)

33
Q

The request contains bad syntax or cannot be fulfilled.

A

4xx (Client Error)

34
Q

The server failed to fulfill an apparently valid request.

A

5xx (Server Error)

35
Q

indicates that the request could be answered without any problems.

A

200 (OK)

36
Q

The target resource has been assigned a new permanent URL, provided by the Location
header field in the response

A

301 Moved Permanently

37
Q

The target resource resides temporarily under a different URL.

A

302 Found

38
Q

The request has not been applied because it lacks valid authentication credentials for the target
resource.

A

401 Unauthorized

39
Q

The Forbidden reponse indicates that, although the request is valid, the server is configured to
not provide it.

A

403 Forbidden

40
Q

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

A

404 Not Found

41
Q

The server encountered an unexpected condition that prevented it from fulfilling the request.

A

500 Internal Server Error

42
Q

The server, while acting as a gateway or proxy, received an invalid response from an inbound
server it accessed while attempting to fulfill the request.

A

502 Bad Gateway

43
Q

that is, the path indicated in the request message corresponds to a file on the server’s local file system

A

static content

44
Q

that is, the HTTP server forwards the request to another program—probably a script‒to build the
response from different sources, such as databases and other files.

A

dynamic content

45
Q

it is important to adopt some content caching strategy to avoid the redundant
transfer of previously downloaded content.

A

caching

46
Q

used by more than a single client. For example, a large content provider might
use caches on geographically distributed servers, so that clients get the data from their nearest
server. Once a client has made a request and its response was stored in a shared cache, other
clients making that same request in that same area will received the cached response

A

shared cache

47
Q

created by the client itself for its exclusive use. It is the type of caching the web
browser does for images, CSS files, JavaScript, or the HTML document itself, so they don’t need to
be downloaded again if requested in the near future.

the client consults the response header and verifies whether the content in the local cache still corresponds to the current remote content - if it does the client waives the trasfer of the response payload and uses the local version

A

private cache

48
Q

A request using the this method, for
example, implies a response associated exclusively with that particular request, so
its response content should not be reused.

A

POST method

49
Q

only responses to requests
made using the GET method are cached.

A

By default

50
Q

Only these status codes are suitable for cacheing

A

200 (OK)
206 (Partial Content)
301 (Moved Permanently)
404 (Not Found)

51
Q

The most traditional method that allows the server to associate different requests to a single client and are an id tag that is given to the client by the server and that is provided in the HTTP header.

allow the server to preserve info about a specific client - even if the person running the client does not identify himself/herself explicitly

it is possible to implement sessions where logins, shopping carts, preferences, etc., are preserved in between different requests made to the same server that provided them.

used to track user browsing, so it is important to ask for consent before sending them

A

cookies

52
Q

The server sets the cookie in the response header using the

A

Set-Cookie field

53
Q

The field value of the Set-Cookie field is a pair chosen to represent some attribute associated with a specific client

A

name=value

54
Q

What HTTP method does the following request message use?

POST /cgi-bin/receive.cgi HTTP/1.1
Host: learning.lpi.org
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: /
Content-Length: 27
Content-Type: application/x-www-form-urlencoded

A

The Post method

55
Q

When an HTTP server hosts many websites, how is it able to identify which one a request is
for?

A

The Host field in the request header provides the targeted website

56
Q

What parameter is provided by the query string of the URL https://www.google.com/
search?q=LPI?

A

The parameter named q with a value of LPI.

57
Q

Why is the following HTTP request not suitable for caching?

POST /cgi-bin/receive.cgi HTTP/1.1
Host: learning.lpi.org
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0
Accept: /
Content-Length: 27
Content-Type: application/x-www-form-urlencodencoded

A

Because requests made with the POST method imply a write operation on the server, they should not be cached

58
Q

How could you use the web browser to monitor the requests and responses made by an HTML
page?

A

All popular browsers offer development tools that, among other things, can show all network transactions that have been carried out by the current page

59
Q

HTTP servers that provide static content usually map the requested path to a file in the server’s filesystem. What happens when the path in the request points to a directory?

A

It depends on how the server is configured. By default, most HTTP servers look for a file named index.html (or another predefined name) in that same directory and send it as the response. If the file isn’t there, the server issues a 404 Not Found response.

60
Q

The contents of files sent over HTTPS are protected by encryption, so they cannot be read by computers between the client and the server. Despite this, can these computers in the middle identify which resource the client has requested from the server?

A

No, because the request and response HTTP headers themselves are also encrypted by TLS.