How do you get default headers in a urllib2 Request?

后端 未结 8 1130
花落未央
花落未央 2020-12-13 07:22

I have a Python web client that uses urllib2. It is easy enough to add HTTP headers to my outgoing requests. I just create a dictionary of the headers I want to add, and pa

8条回答
  •  轮回少年
    2020-12-13 08:19

    see urllib2.py:do_request (line 1044 (1067)) and urllib2.py:do_open (line 1073) (line 293) self.addheaders = [('User-agent', client_version)] (only 'User-agent' added)

提交回复
热议问题