List Info

Thread: Sending a header with exactly no contents




Sending a header with exactly no contents
user name
2007-05-25 02:54:21
Hi,

I need to send an header with exacly no contents like that:
X-Header:

I9;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
Re: Sending a header with exactly no contents
user name
2007-05-25 03:23:34
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:
PyCurlrnEmptyHeader:')
...
"""

regards,
    - kjetil

On 5/25/07, Frédéric PICA <frederic.picagmail.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-an
d-python
>
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-an
d-python

Re: Sending a header with exactly no contents
user name
2007-05-25 04:06:24
the example in my previous port is wrong, should have been:

"""
c = pycurl.Curl()
c.setopt(pycurl.HTTPHEADER, ['User-Agent:
PyCurlrnEmptyHeader:'])
...
"""

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

    - kjetil

On 5/25/07, Kjetil Jacobsen <kjetiljagmail.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:
PyCurlrnEmptyHeader:')
> ...
> """
>
> regards,
>     - kjetil
>
> On 5/25/07, Frédéric PICA <frederic.picagmail.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-an
d-python
> >
> >
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-an
d-python

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )