Oauth2 401 response is missing WWW-Authenticate header


#1

Hi all,

When encountering a 401 response doing a rest request I don’t receive any WWW-Authenticate header in the response, which seems strange. Why is that?

See logged interaction below. I’ve deliberately altered the access token in the request to trigger a 401.

Request
Address: https://api.twitter.com/1.1/search/tweets.json?q=%23freebandnames&since_id=24012619984051000&max_id=250126199840518145&result_type=mixed&count=4
Http-Method: GET
Content-Type:
Headers: {Authorization=[Bearer AAAAAAAAAAAAAAAAAAAAEK2xAAAAdEo2x4sB5aGdSmvj6P%2Fei1IrP%2B8%3DrUqZ1WuWsu0o9ijzDAOhMEkIwldkLcL5T81J49i6qz6], Accept=[/]}

Response:
Response-Code: 401
Encoding: UTF-8
Content-Type: application/json; charset=utf-8
Headers: {Content-Length=[62], content-type=[application/json; charset=utf-8], date=[Tue, 27 Sep 2016 11:28:05 GMT], server=[tsa_b], set-cookie=[guest_id=v1%3A147497568573627308; Domain=.twitter.com; Path=/; Expires=Thu, 27-Sep-2018 11:28:05 UTC], strict-transport-security=[max-age=631138519], x-connection-hash=[08cfcf6f25aa88853f701586fe25d387], x-response-time=[4]}
Payload: {“errors”:[{“code”:89,“message”:“Invalid or expired token.”}]}