cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTPPOST is not working with servlet

From: Shirish Kulkarni <shirishgk7_at_gmail.com>
Date: Fri, 26 Sep 2008 17:19:44 +0530

Thanks Daniel.

I never thought if servlet has a problem as it was working when the request
were made using a HTML form. I explicitly specified
ENCTYPE="multipart/form-data", and I was surprised to know that this didn't
worked when form posted though a HTML page.

I wrote to this mail group because I've seen similar issues in the
curl-library archives.

I've found the answer for my problem at
http://www.jguru.com/faq/view.jsp?EID=1045507

Thanks again.

On Fri, Sep 26, 2008 at 4:36 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 25 Sep 2008, Shirish Kulkarni wrote:
>
> I just tried an example (multi-post.c) given in documentation and used a
>> servlet. CURLOPT_POSTFIEDS works perfectly with servlet, but it has a
>> limitation that only one parameter can be passed at a time
>>
>
> One parameter? If you call one stream of data "one parameter", then sure
> but you can send any number of bytes any way you want. Few people I know
> would call that "one parameter".
>
> and also it could not be used if I wanted to do an operation like uploading
>> a file.
>>
>
> Yes it can, but it's a bit fiddly. curl_formadd() and friends are however
> crafted to offer that ability in a convenient way.
>
> This doesn't seem to be working with servlets.
>>
>
> libcurl works fine with HTTP, so if what you send doesn't play well with
> your servlet then you probably don't send the right things or your servlet
> is buggy.
>
> --
>
> / daniel.haxx.se
>
Received on 2008-09-26