The client must authenticate to the network (captive portal) before accessing the resource.
511 Network Authentication Required is the captive-portal status code. When a public WiFi network requires you to log in (hotel, airport, coffee shop), a properly-configured network gateway returns 511 with a body pointing at the login page. Most captive portals do not actually use 511; they intercept all HTTP traffic with a redirect to the login page, which is messier but more compatible with broken clients.
When servers should return it: Return 511 from network gateways when the client has not authenticated to the network.
HTTP/1.1 511
content-type: text/html
<html><body>You must <a href="https://wifi.example.com/login">log in to the network</a>.</body></html>
For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.