curl-library
Issue with HTTP Post with Authentication - curl 7.12.2
Date: Mon, 12 Dec 2005 20:57:50 +0530
Hi
I am using curl library version 7.12.2 and trying to make
Web Service calls over HTTP using libcurl (i.e. HTTP Post requests). My
web service requires authentication so I set appropriate options,
however for some reason curl does not send Post request directly, it
first tries to send a Head request which fails since server does not
support head requests. I tried to look into the code and found that in
Curl_http method (file http.c) we have following piece of code, which
makes the Head request before the post. I commented this logic and
things worked fine, now I am not sure what is the side-effect of this,
does anyone has more information?
if((!data->state.authhost.done || !data->state.authproxy.done ) &&
(httpreq != HTTPREQ_GET)) {
/* Until we are authenticated, we switch over to HEAD. Unless its a
GET
we want to do. The explanation for this is rather long and
boring, but
the point is that it can't be done otherwise without risking
having to
send the POST or PUT data multiple times. */
httpreq = HTTPREQ_HEAD;
request = (char *)"HEAD";
conn->bits.no_body = TRUE;
conn->bits.authprobe = TRUE; /* this is a request done to probe for
authentication methods */
}
else
conn->bits.authprobe = FALSE;
Thanks
Dinesh
Received on 2005-12-12