cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Request is getting truncated by my WAS App server

From: Cobb, Richard <Richard.Cobb_at_libertymutual.com>
Date: Thu, 12 May 2005 09:38:18 -0400

Many thanks for the info, I don't need multi-part. How do I make the
code do a POST?

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of man_at_tfhs.net
Sent: Thursday, May 12, 2005 9:14 AM
To: libcurl development
Subject: RE: Request is getting truncated by my WAS App server

richard, your original code uses a GET request, not a POST. that's why
it shows up in the url, and why it is truncated.

when you use an html form, are you using a file upload box? your browser
likely makes it into a POST, even if you are pasting the xml directly
into a text box.

you can make it post without it being multi-part, unless you are
planning to use the file upload design.

allan

On Wed, May 11, 2005, "Cobb, Richard" <Richard.Cobb_at_LibertyMutual.com>
said:

> Sorry, hit send to early...
>
> The return code was good when I ran it before, I cut out the error
> logic to make the example easier to follow. I did however get a
> message to large error from my WAS server. When I hit my PC WSAD app
> server it just truncates with no error message. I really don't want a

> multi part form because I just want to send an xml request to the
> server. And yes you are right, what I think is happening is that the

> entire request is getting sent in the header, nothing is appearing
> inside the request body. From my monitor the request looks like a get

> request www.testme.com/myservlet?XMLData="<alota data>" It comes in on

> one long line and does not appear inside the request body. When I
> send a sample request via an HTML form it works just fine and the XML
> data is in the body. Sorry to be confusing before...
>
> -----Original Message-----
> From: curl-library-bounces_at_cool.haxx.se
> [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel
> Stenberg
> Sent: Wednesday, May 11, 2005 6:20 PM
> To: libcurl development
> Subject: Re: Request is getting truncated by my WAS App server
>
>
> 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