HTTP Flashcards

1
Q

What is a client?

A

A “service requester” in the client-server model; a program on a computer that requests data from a server

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

What is a server?

A

The provider of a resource or service in the client-server model; a program on a computer that provides data to clients that request it

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

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

The HTTP method (e.g. GET, POST), the request target (URL), and the HTTP version

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

The protocol version (usually HTTP/1.1), the status code (e.g. 200, 404), and the status text

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

What are HTTP headers?

A

Lines of code that contain the meta data of an HTTP request or response

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

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

A

No

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

What does fetch() return?

A

A Promise that resolves into a Response object modeling the response of the http request

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

What is the default request method used by fetch()?

A

GET

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

How do you specify the request method (GET, POST, etc.) when calling fetch?

A

In the 2nd argument, provide an object with the property method: 'GET'

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