qbq
qbq

Reputation: 95

What is the default client header in Python requests?

What is the default client header string in python requests module? I use Ubuntu 18.04 and Python 3.x

Note that I use Session() object as follows:

se = requests.Session()
se.mount("https://",mytlsAdapter())

and mytlsAdapter() is used to configure some TLS configurations similar to the description here, but not touched anything related to the client headers.

I did not specify any client header string. But I need to know what is the default one if I do not specify one. How to figure this out?

Upvotes: 0

Views: 2754

Answers (1)

John Gordon
John Gordon

Reputation: 33345

The response object includes the request object that generated it.

So, you can see what headers were sent:

response = requests.get(...)
print response.request.headers

Upvotes: 3

Related Questions