Skip to content
Advertisement

Python requests WWW-Authenticate missing in headers

I’m trying to access the WWW-Authenticate header after a GET request using Python’s requests library. When I do this in Postman it returns it but in Python it doesn’t.

Python:

JavaScript

headers:

JavaScript

Postman: enter image description here

I’ve tried every headers param I can find but can’t seem to return the WWW-Authenticate response header which I need…any help would be much appreciated.

Edit:

Within Postman, it looks to be the Host key in the headers get request that’s generating the WWW-Authenticate in the response headers. When I remove it (in Postman) I get only a handful of headers in the response headers. But how would I replicate this in Python’s requests library?

This is what it says when hovering over the Host header in GET: enter image description here

Advertisement

Answer

Pass the request headers to the server:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement