curl-and-python

Re: Replacing all request headers

From: Kjetil Jacobsen <kjetilja_at_gmail.com>
Date: Thu, 9 Mar 2006 12:22:39 +0100

CURLOPT_HTTPHEADER should work:

http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHTTPHEADER

CURLOPT_HTTPHEADER in pycurl:
"""
c = pycurl.Curl()
...
c.setopt(pycurl.HTTPHEADER, ['Content-Type: application/octet-stream',
'User-Agent: blah'])
...
"""

On 3/8/06, Steven Feil <sfeil_at_io.com> wrote:
> How can I replace all request headers and use only the ones I choose?
> I'm trying to get curl to work with a particular website, however this
> website is programmed not to work unless it thinks it is talking to a
> browser like Internet Explorer or Mozilla. I would like to replace
> all request headers, not just "User-Agent", so that I can fool the
> site. I was able to do this with the command line program curl, but I
> have not found how to do this with lib curl.
>
>
> --
> =======================================================================
> Steven Feil | Gram-pa, back at the turn of the .~.
> Programmer/Developer | century, why did people use an /V\
> sfeil_at_io.com | operating system, when they were not // \\
> | allowed to see the source code? (X_X)
> =======================================================================
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2006-03-09