curl-and-python

Re: Sending a header with exactly no contents

From: Kjetil Jacobsen <kjetilja_at_gmail.com>
Date: Fri, 25 May 2007 11:06:24 +0200

the example in my previous port is wrong, should have been:

"""
c = pycurl.Curl()
c.setopt(pycurl.HTTPHEADER, ['User-Agent: PyCurl\r\nEmptyHeader:'])
...
"""

HTTPHEADER assumes a list as argument, not a string. sorry about that.

    - kjetil

On 5/25/07, Kjetil Jacobsen <kjetilja_at_gmail.com> wrote:
> hi,
>
> this does not appear to be supported by libcurl, see:
>
> http://curl.haxx.se/mail/lib-2006-01/0244.html
>
> one of the hacks mentioned in that thread is to embed the empty header
> in another header, e.g.:
>
> """
> c = pycurl.Curl()
> c.setopt(pycurl.HTTPHEADER, 'User-Agent: PyCurl\r\nEmptyHeader:')
> ...
> """
>
> regards,
> - kjetil
>
> On 5/25/07, Frédéric PICA <frederic.pica_at_gmail.com> wrote:
> > Hi,
> >
> > I need to send an header with exacly no contents like that:
> > X-Header:
> >
> > I've tried using double quotes like
> > "X-Header:" or X-Header: ""
> >
> > curl sends me the header with the double quotes but for the server it
> > doesn't work, it needs exactly X-Header:
> > with nothing after ':'
> >
> > Regards,
> > FP
> >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
> >
> >
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2007-05-25