cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: question on "--request":can I remove the " /" after the request?

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 1 Mar 2004 10:28:04 +0100 (CET)

On Mon, 1 Mar 2004, FUN TOES wrote:

> curl -v0 --request "GET http://www.google.com/search?hl=en" targetproxy.
> I found the http request sent like this:
> > GET http://www.google.com/search?hl=en / HTTP/1.0
> Can I remove the " /" before " HTTP/1.0"?

No you can't. And no, you're not supposed to use that option like that since
it creates weird HTTP requests, exactly as you found out.

Removing the path from the request just because you abuse the 'request' option
is not an option for libcurl.

> (some httpproxy will give error for it).

So why do you use it like this?

> I step into url.c with gdb,but I can't find where the " /" was append to the
> urlbuffer.After a do_curl() call,this request is sent.I can't find what is
> the do_curl() used. Would you like give me some clues?

The code that creates the whole HTTP request is in Curl_http(). I can't give
you any exact line numbers since my devel version is much changed since the
latest official release, but if you checkout from CVS it is line 1345 in
lib/http.c.

> Because of the targetproxy I used is usually the second proxy.(culr -p -U
> user:pass -x httpproxy1:port1 -X "GET http://target/search?..." -0
> proxy2:port2).I have no other choice.

I don't follow you. Are you saying that you're trying to make your request go
through two proxies? Can you show us a complete command line that you think
would do this? (If it would cut out the extra path)

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
Received on 2004-03-01