3 ms·
The use of 401 Unauthorized is an annoying one because of a little thing in the spec: The response MUST include a WWW-Authenticate header field (section 14.47)
by shdon 12y ago
The use of 401 Unauthorized is an annoying one because of a little thing in the spec: The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource.
AFAICT, This makes it makes it inapplicable to REST APIs that do not use basic or digest authentication, at least without violating the spec for the 401 response code.
Is there something that I've missed?
- justinsb 12y agoWhy not pass a dummy value to satisfy the spec?
- dragonwriter 12y agoBecause a dummy value satisfies the syntax but not semantics of the spec.
- hawleyal 12y ago400 Bad Request is often a better, albeit generic, option.
- deleted 12y ago[deleted]