freecoding.school100% FREE · NO SIGNUP
Endpoint BayISSUE #8 of 45

urls · scheme · host · path · query · fragment

RestaVSThe 401 Bandit
Resta saysA URL has parts: scheme, host, port, path, query, and fragment.

https://api.example.com:443/v1/users?role=admin#top breaks down as: scheme (https), host (api.example.com), port (443), path (/v1/users), query (?role=admin), fragment (#top, client-only). APIs identify resources by path and refine with query parameters. Knowing the anatomy keeps your requests precise.

Power-ups you unlock

The 401 Bandit attacks — common mistakes

Boss battleBreak a real API URL into its six parts.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>https://api.x.com:443/v1/users?role=admin#top
scheme host           port path     query     frag</pre></body></html>
▶ Open the interactive comic issue
‹ Response Headers · Cors · Cache · Set-CookieQuery Strings · Key=Value · Encoding ›