Alex Rivera | Logout

Custom headers with pycurl

Asked 2010-06-15T11:45:53.163
26

Can I send a custom header like "yaddayadda" to the server with the pycurl request?

Edit
Report

1 Answer

54

I would code something like:

pycurl_connect = pycurl.Curl()
pycurl_connect.setopt(pycurl.URL, your_url)
pycurl_connect.setopt(pycurl.HTTPHEADER, ['header_name1: header_value1',
                                          'header_name2: header_value2'])
pycurl_connect.perform()
answered 2010-06-15T12:11:52.580

Your Answer