cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTPPOST is not working with servlet

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 26 Sep 2008 13:06:59 +0200 (CEST)

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