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:
- Scheme — the protocol, for example,
httporhttps. - Host — the domain name or IP address of the server.
- Path — indicates the resource, for example,
/users/123. - Query parameters — additional data in the format
?key=value&key2=value2. - Fragment — the part after
#, usually not used in REST requests.
Example:
https://api.example.com/users/123?active=true
https— schemeapi.example.com— host/users/123— path to the resourceactive=true— query parameter
In REST, the URL path usually reflects the hierarchy of resources, and parameters are filters or additional options.