Podcast
Questions and Answers
What is the primary function of a URL?
What is the primary function of a URL?
What is the purpose of the 'scheme' component in a URL?
What is the purpose of the 'scheme' component in a URL?
What is the function of the 'query string' component in a URL?
What is the function of the 'query string' component in a URL?
What is the purpose of the 'fragment' component in a URL?
What is the purpose of the 'fragment' component in a URL?
Signup and view all the answers
What is the default port number used for HTTP connections?
What is the default port number used for HTTP connections?
Signup and view all the answers
What is the purpose of the 'Host' header in an HTTP request?
What is the purpose of the 'Host' header in an HTTP request?
Signup and view all the answers
What does the HTTP status code '200 OK' indicate?
What does the HTTP status code '200 OK' indicate?
Signup and view all the answers
What is the purpose of the 'Referer' header in an HTTP request?
What is the purpose of the 'Referer' header in an HTTP request?
Signup and view all the answers
What is the minimum amount of information required to make a request to a web server?
What is the minimum amount of information required to make a request to a web server?
Signup and view all the answers
What is the purpose of the blank line at the end of an HTTP request?
What is the purpose of the blank line at the end of an HTTP request?
Signup and view all the answers
Study Notes
URL Structure
- A URL is an instruction on how to access a resource on the internet.
- A URL consists of: scheme, user, host, port, path, query string, and fragment.
URL Components
- Scheme: The protocol to use for accessing the resource (e.g. HTTP, HTTPS, FTP).
- User: The username and password for authentication (optional).
- Host: The domain name or IP address of the server (e.g. tryhackme.com).
- Port: The port number to connect to (e.g. 80 for HTTP, 443 for HTTPS).
- Path: The file name or location of the resource (e.g. /view-room).
- Query String: Extra information sent to the requested path (e.g. ?id=1).
- Fragment: A reference to a location on the actual page requested (e.g. #task3).
Making a Request
- A request can be made with a single line "GET / HTTP/1.1".
- Additional data can be sent in headers, which contain extra information for the web server.
Request and Response Breakdown
- Request:
- GET method requests the home page.
- Host header specifies the website (e.g. tryhackme.com).
- User-Agent header specifies the browser (e.g. Mozilla/5.0 Firefox/87.0).
- Referer header specifies the referring webpage (e.g. https://tryhackme.com/).
- Response:
- HTTP version and HTTP Status Code (e.g. HTTP/1.1 200 OK).
- Server information (e.g. Server: nginx/1.15.8).
- Date and time of the response (e.g. Date: Fri, 09 Apr 2021 13:34:03 GMT).
- Content type and length (e.g. Content-Type: text/html, Content-Length: 98).
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Quiz on URLs, also known as Uniform Resource Locators, and how they instruct browsers to access resources on the internet.