Web Requests - HTTP Requests and Responses Flashcards

1
Q

What are the two main components of HTTP communications?

A

HTTP request and HTTP response

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

Who makes the HTTP request in the communication process?

A

The client (e.g. cURL/browser)

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

What does the HTTP request contain?

A

Resource details, request data, headers, and options

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

What does the server send back after processing an HTTP request?

A

HTTP response

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

What is the first line of an HTTP request comprised of?

A

Method, Path, and Version

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

What does the ‘Method’ field in an HTTP request specify?

A

The type of action to perform

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

What does the ‘Path’ field in an HTTP request indicate?

A

The path to the resource being accessed

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

What is the purpose of HTTP headers in a request?

A

To specify various attributes of a request

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

How is the end of HTTP headers indicated?

A

With a new line

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

What is the difference between HTTP version 1.X and 2.X in terms of data transmission?

A

1.X sends requests as clear-text; 2.X sends requests as binary data

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

What does the first line of an HTTP response contain?

A

HTTP version and HTTP response code

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

What are response codes used for in HTTP?

A

To determine the request’s status

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

What types of content can an HTTP response body contain?

A

HTML, JSON, images, style sheets, scripts, or documents

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

What command can be used to view the full HTTP request and response with cURL?

A

-v verbose flag

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

What does the HTTP response code ‘401 Unauthorized’ indicate?

A

Lack of access to the requested resource

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

What are browser DevTools primarily intended for?

A

For developers to test their web applications

17
Q

How can you open browser DevTools in Chrome or Firefox?

A

By clicking CTRL+SHIFT+I or F12

18
Q

What tab in browser DevTools is primarily focused on web requests?

A

Network tab

19
Q

What happens when you refresh a page with the Network tab open?

A

A list of requests sent by the page is displayed

20
Q

True or False: The Network tab shows the response status and request method used.

21
Q

Fill in the blank: HTTP requests are made by the _______.