cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Request is getting truncated by my WAS App server

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 12 May 2005 00:19:56 +0200 (CEST)

On Wed, 11 May 2005, Cobb, Richard wrote:

> I am new to Curl and am trying to fix some old code (someone wrote long ago)
> that only sends the first 2k of the request. I put a scope on it and it
> seems to be coming in with the URL and not placing the XML inside the HTTP
> Header.

What libcurl version on what OS?

What happens when it stops? What does curl_easy_perform() return then?

> printf("%s",pTURL);
> curl_easy_setopt(localcurlHndl, CURLOPT_URL,
> "http://10.110.188.229:9080/curlGetPost/curlGetPost" );
> curl_easy_setopt(localcurlHndl, CURLOPT_POSTFIELDS,pTURL);
> curl_easy_setopt(localcurlHndl, CURLOPT_POSTFIELDSIZE,
> strlen(pTURL));
>
> curl_easy_perform(localcurlHndl);

Whoa, if you fetch the return code (and CURLOPT_ERRORMESSAGE) it might
actually tell you more about the problem.

The code looks fine to me otherwise.

> The question is do I need to use the curl_formadd to get this data inside
> the header?

POST data should not be and is not in the header in case, POST data is in the
request-body. The above snippet will put the data in the request-body, and so
will curl_formadd() and CURLOPT_HTTPPOST, but formadd makes multipart
formposts, which your current code does not.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-05-12