Understanding URLs

ExaltingBinomial avatar
ExaltingBinomial
·
·
Download

Start Quiz

Study Flashcards

10 Questions

What is the primary function of a URL?

To instruct the browser on how to access a resource on the internet

What is the purpose of the 'scheme' component in a URL?

To instruct on what protocol to use for accessing the resource

What is the function of the 'query string' component in a URL?

To provide extra bits of information to the requested path

What is the purpose of the 'fragment' component in a URL?

To reference a location on the actual page requested

What is the default port number used for HTTP connections?

80

What is the purpose of the 'Host' header in an HTTP request?

To specify the website being requested

What does the HTTP status code '200 OK' indicate?

The request has completed successfully

What is the purpose of the 'Referer' header in an HTTP request?

To specify the webpage that referred to the current webpage

What is the minimum amount of information required to make a request to a web server?

The HTTP method, the requested page, and the HTTP protocol version

What is the purpose of the blank line at the end of an HTTP request?

To inform the web server that the request has finished

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).

Quiz on URLs, also known as Uniform Resource Locators, and how they instruct browsers to access resources on the internet.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

YouTube URL Parameters Quiz
3 questions
Dynamic Web Design Fundamentals Quiz
24 questions
URL Shortener Service
10 questions

URL Shortener Service

DazzledNoseFlute avatar
DazzledNoseFlute
Use Quizgecko on...
Browser
Browser