http-messages Flashcards

1
Q

What is a client?

A

a client is a service requester who usually does not share any of their resources or services and await incoming request

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

What is a server?

A

providers of a resource or service

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

Which HTTP method does a browser issue to a web server when you visit a URL?

A

GET is the HTTP method that indicates that a resource should be fetched

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

What three things are on the start-line of an HTTP request message?

A

1st - an HTTP method that describes the action to be performed (WHAT ARE WE DOING)
2nd - the request target, which is usually a URL, or the absolute path of the protocol, port, and domain are usually characterized by the request context. (WHERE IS THIS GOING)
last is the HTTP version which defines the structure of the remaining message, acting as an indicator of the expected version that will be used for the response

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

What three things are on the start-line of an HTTP response message?

A

1st is the protocol version, usually HTTP/1.1
2nd is a status code indicating the success or failure of the request (common codes are 300, 404, 302)
3rd is a status text. a brief purely informational, textual description of the status code to help the human understand the HTTP message

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

What are HTTP headers?

A

a case insensitive string followed by a colon and a value who’s structure depends upon the header. The entire value consists of one single line that can be quite long. THIS IS METADATA ABOUT A REQUEST
________________
Many different headers can appear in requests. They can be divided in several groups:

General headers, like Via, apply to the message as a whole.

Request headers, like User-Agent or Accept, modify the request by specifying it further (like Accept-Language), by giving context (like Referer), or by conditionally restricting it (like If-None).

Representation headers like Content-Type that describe the original format of the message data and any encoding applied (only present if the message has a body).

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

Where would you go if you wanted to learn more about a specific HTTP Header?

A

visit the MDN of that specific header

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

Is a body required for a valid HTTP request or response message?

A

A body is not required for a valid HTTP request or response message. ex. fetching requests like GET HEAD DELETE or OPTIONS usually don’t have one

Bodies can be broadly divided into two categories:

Single-resource bodies, consisting of one single file, defined by the two headers: Content-Type and Content-Length.
Multiple-resource bodies, consisting of a multipart body, each containing a different bit of information. This is typically associated with HTML Forms.

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