Repaso
Español
Backend & APIsFoundationsAPI-49

In the address https://api.shop.com/products?id=7, which part is the path?

Options

  1. https
  2. api.shop.com
  3. /products (Correct option)
  4. id=7

Answer

/products

Why

A URL is made of parts:

  • https is the scheme (protocol).
  • api.shop.com is the host (the server's domain name).
  • /products is the path (which resource on that server).
  • ?id=7 is the query string (extra parameters).

The port is hidden: HTTPS uses 443 by default and HTTP uses 80.

Remember

URL = scheme + host + path + query.

Key terms

Practice this question in Repaso