httpstatuses/contents/codes/401.md
Samuel Ryan d8a693bf27 Remove markdown line limit (#52)
* Removes line length limit from Status Code Markdown

This will make the data easier to use when we develop the API, it needs
to be consistent, arbitrary new lines (especially in text format) will
be a major issue, so some sort of workaround would have to be
implemented, easier to simply fix the source files.

* Removes line length limit from misc. Markdown files
2016-04-23 01:12:07 +01:00

1.4 KiB

set code title references
4 401 Unauthorized
Rails HTTP Status Symbol Go HTTP Status Constant Symfony HTTP Status Constant
:unauthorized http.StatusUnauthorized Response::HTTP_UNAUTHORIZED

The request has not been applied because it lacks valid authentication credentials for the target resource.

The server generating a 401 response MUST send a WWW-Authenticate header field1 containing at least one challenge applicable to the target resource.

If the request included authentication credentials, then the 401 response indicates that authorization has been refused for those credentials. The user agent MAY repeat the request with a new or replaced Authorization header field2. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user agent SHOULD present the enclosed representation to the user, since it usually contains relevant diagnostic information.