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.

and the file can be huge too. I tried setting CURLOPT_POSTFIELDS to
"\?alias=true".

POSTFIELDS is for the POST request-body, the request-URI string that comes after the POST is created from the URL you tell libcurl.

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.

--

 / daniel.haxx.se

Reply via email to