Web Requests - GET Flashcards
What is the default HTTP method browsers use to obtain resources from a URL?
GET
What can be monitored in the Network tab of the browser devtools?
Requests sent by the browser to obtain resources
What type of authentication is handled directly by the webserver to protect specific pages?
Basic HTTP authentication
What credentials are used in the example for HTTP Basic Auth?
admin:admin
What command is used to view response headers in cURL?
-i
True or False: The WWW-Authenticate header confirms the use of basic HTTP auth.
True
What flag is used in cURL to provide basic HTTP auth credentials?
-u
Fill in the blank: When using basic HTTP auth, the Authorization header contains the value _______.
Basic YWRtaW46YWRtaW4=
What does the Authorization header value represent when using basic HTTP auth?
Base64 encoded value of username:password
What is an alternative method to provide basic HTTP auth credentials in a URL?
(username:password@URL)
What type of authentication do most modern web applications use?
Login forms with HTTP POST requests
What function can be accessed once authenticated in the example?
City Search function
What kind of request is sent to obtain search results in the example?
GET request
Which file is queried for search results in the example?
search.php
How can you send a GET request with cURL for a specific search?
Use the URL with the search parameter included
What shortcut opens the Network tab in browser devtools?
[CTRL+SHIFT+E]
What method can be used to copy a request as a cURL command in the browser devtools?
Right-click > Copy > Copy as cURL
What does the command ‘curl -H ‘Authorization: Basic YWRtaW46YWRtaW4=’ http://<SERVER_IP>:<PORT>/' do?</PORT></SERVER_IP>
Authenticates and accesses the page using basic HTTP auth
What are the expected results when executing a GET request to search.php with a valid search term?
A list of matching cities
What is the purpose of the ‘network_clear_requests’ action mentioned in the text?
To clear previous requests and monitor only new requests
What does the copied cURL command from the Network tab include?
All headers used in the HTTP request
What command can be used to repeat a request in the browser devtools using the Fetch API?
Copy > Copy as Fetch
What happens when you manually set the Authorization header without supplying credentials?
You may still access the page if the header is correct