cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: how to Enable always absolute URL PATH in libcurl HTTP POST request.

From: Yehezkel Horowitz <horowity_at_checkpoint.com>
Date: Thu, 3 Oct 2013 14:03:43 +0000

>Hi All,

>I have a HTTP server which is accepting only absolute URL path in HTTP POST request.
After connecting to the server the libcurl sends only the relative URL in the POST request.
So, Please suggest me the way to make libcurl to send absolute (complete) URL in the POST request.

libcurl is acting according to the HTTP/1.1 protocol in this case, and if your server expect the host as part of the request line (and not in Host header) - then it violate the HTTP/1.1 protocol.

You might try to downgrade to HTTP/1.0 protocol, with CURLOPT_HTTP_VERSION (http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHTTPVERSION).

HTH

Yehezkel Horowitz

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-10-03