cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: 502 Proxy Error while POSTing files bigger than 65K

From: Michael Wood <esiotrot_at_gmail.com>
Date: Tue, 18 Aug 2009 15:19:12 +0200

2009/8/18 Daniel Stenberg <daniel_at_haxx.se>:
> On Tue, 18 Aug 2009, Rahul Rathi wrote:
>
>> POST http://207.200.36.91 HTTP/1.1\r\n
>>
>> By the way, the URL http://207.200.36.91 which is included in the first
>> line
>> immediately after POST, how can i avoid this ?
>
> That's how a POST request looks like when sent to a proxy. You can't avoid
> that when talking HTTP.
>
>> Sometimes, i want to generate a POST request like this:
>> POST /?alias=yes HTTP/1.1
>
> No, not if you're talking to a proxy.

i.e. set the URL to "http://207.200.36.91/?alias=yes". That full URL
will show up because you are going through a proxy server, but the
actual web server should see: "POST /?alias=yes HTTP/1.1"

>> Also, for PUT request i want to achieve something like this:
>> PUT /41A140B5271DC8D22FF8D027176A0821 HTTP/1.1
>> Host: xxx.xxx.com
>
> No you don't if you still use the proxy. But otherwise you can again get the
> path right by setting the correct CURLOPT_URL.

Again, set the CURLOPT_URL to
"http://xxx.xxx.com/41A140B5271DC8D22FF8D027176A0821" and it should
work, but the request will include the full URL instead of just "PUT
/... HTTP/1.1" because of the proxy, but the web server should see it
as you have it above.

-- 
Michael Wood <esiotrot_at_gmail.com>
Received on 2009-08-18