cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: problem with libcurl 7.8 POST

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 3 Aug 2001 10:36:35 +0200 (MET DST)

On Tue, 31 Jul 2001, Nataly Geimakher wrote:

> I am using libcurl 7.8 version trying to post data to the server (java
> servlet) through following lines of code (after I get curl object from
> init):

> ...curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
> curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
> curl_easy_setopt(curl, CURLOPT_POST,1);
> curl_easy_setopt(curl, CURLOPT_URL, "UrlOfMyServlet "); (something like
> http://Site/Servlet)
> char* params = "reportName=resp&timeFrame=Month";
> curl_easy_setopt(curl,CURLOPT_POSTFIELDS, params);
> res = curl_easy_perform(curl);
>
> the output, that I get when verbose is set, is following:
> > POST /UrlOfMyServlet HTTP/1.1
> Host: mouse:8080
> Pragma: no-cache
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 31
> Content-Type: application/x-www-form-urlencoded
>
> reportName=resp&timeFrame=Month
> * Closing live connection (#0)

This looks like a perfect POST to me.

> Even though I do get to that servlet on the server's side, I do not see
> any of the parameters that I send with the post!!

Well, as we can see in the debug output, libcurl sends you the data. If your
end doesn't receive that data correctly, I'm not sure how this can be
libcurl's fault.

> Can you please tell me, what am I doing wrong?

I'm afraid I can't. I see a perfectly valid POST here.

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
http://curl.haxx.se/libcurl/
Received on 2001-08-03