cURL / Mailing Lists / curl-users / Single Mail


Re: How do I do this?

From: Daniel Stenberg <>
Date: Thu, 16 Jun 2005 09:24:45 +0200 (CEST)

On Wed, 15 Jun 2005, Chris Glon wrote:

> I am running cURL on Sun HW under Solaris:
> curl 7.10.3 (sparc-sun-solaris2.8) libcurl/7.10.3 OpenSSL/0.9.6g zlib/1.1.3

You should consider upgrading. curl has gotten a LOT better since that

> /opt/bin/curl -G -v --trace-ascii - --max-time 15 -o test.out --url
> http://xx.xx.80.249:19710 -d
> "page=1&type=g&scale=100&width=0&height=0&length=6497" --data-binary
> @O205893.pdf

> 0000: GET /?page=1&type=g&scale=100&width=0&height=0&length=6497
> 0040:
> 0080: &%PDF-1.1 HTTP/1.1

Hm, are you sure this is really what you want? To me it looks like the file
has a binary zero in there, and the code that sends the GET string uses a
plain printf("%s") style output and thus do not support sending a binary zero
in the GET string.

But a zero is not a legal letter to use there anyway, which makes me suspect
that you're doing something you don't really want to.

> What I have been wondering is wether I should (can?) send two requests: The
> 128 char string, keep the connection opened, then send in a 2nd step the
> actual file contents.

No, who subsequent curl invokes can never keep the connection alive between
them. But HTTP is stateless, why do you need to keep the connection alive?

  Commercial curl and libcurl Technical Support:
Received on 2005-06-16