Web Requests - HTTP Requests and Responses Flashcards
What are the two main components of HTTP communications?
HTTP request and HTTP response
Who makes the HTTP request in the communication process?
The client (e.g. cURL/browser)
What does the HTTP request contain?
Resource details, request data, headers, and options
What does the server send back after processing an HTTP request?
HTTP response
What is the first line of an HTTP request comprised of?
Method, Path, and Version
What does the ‘Method’ field in an HTTP request specify?
The type of action to perform
What does the ‘Path’ field in an HTTP request indicate?
The path to the resource being accessed
What is the purpose of HTTP headers in a request?
To specify various attributes of a request
How is the end of HTTP headers indicated?
With a new line
What is the difference between HTTP version 1.X and 2.X in terms of data transmission?
1.X sends requests as clear-text; 2.X sends requests as binary data
What does the first line of an HTTP response contain?
HTTP version and HTTP response code
What are response codes used for in HTTP?
To determine the request’s status
What types of content can an HTTP response body contain?
HTML, JSON, images, style sheets, scripts, or documents
What command can be used to view the full HTTP request and response with cURL?
-v verbose flag
What does the HTTP response code ‘401 Unauthorized’ indicate?
Lack of access to the requested resource
What are browser DevTools primarily intended for?
For developers to test their web applications
How can you open browser DevTools in Chrome or Firefox?
By clicking CTRL+SHIFT+I or F12
What tab in browser DevTools is primarily focused on web requests?
Network tab
What happens when you refresh a page with the Network tab open?
A list of requests sent by the page is displayed
True or False: The Network tab shows the response status and request method used.
True
Fill in the blank: HTTP requests are made by the _______.
client