Sobes.tech
Middle

What does a REST request URL consist of?

sobes.tech AI

Answer from AI

The URL of a REST request consists of several parts:

  1. Scheme — the protocol, for example, http or https.
  2. Host — the domain name or IP address of the server.
  3. Path — indicates the resource, for example, /users/123.
  4. Query parameters — additional data in the format ?key=value&key2=value2.
  5. Fragment — the part after #, usually not used in REST requests.

Example:

https://api.example.com/users/123?active=true
  • https — scheme
  • api.example.com — host
  • /users/123 — path to the resource
  • active=true — query parameter

In REST, the URL path usually reflects the hierarchy of resources, and parameters are filters or additional options.

What does a REST request URL consist of? — System… - sobes.tech