cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Posting Data Problem

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 16 Feb 2002 19:26:48 +0100 (MET)

On Wed, 13 Feb 2002, Marvin Wright wrote:

> I connect to a particular server where I must post variables. I can not get
> it to work with curl for some reason.

It would help if you would show us some basics on how you do this.

> There seems to be something odd about the server I'm connecting to, I can
> post things to other server no problem. This does work in libwww.

I'm not at all aware of how libwww works or how it differs from libcurl in
these aspects, so I'm afraid it doesn't give me much clues.

> * Connected to 195.60.22.227 (195.60.22.227)
> POST /sTrLinkTX3/TrLinkTX3.asp HTTP/1.1
> Host: 195.60.22.227
> Pragma: no-cache
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 824
> Content-Type: application/x-www-form-urlencoded
> ...
> ...
> ...
> * Closing connection #0
> Error : [Failed writing body]

This seems to be because the write callback you've provided returned a
different size than what was passed to it, which libcurl considers an error.

> The strange thing is in libwww the content-length is much bigger

Uh? Then how do you pass the post data (and size) to libcurl?

> and the content-type is
> Content-Type: application/x-www-form-urlencoded

Yes, isn't that exactly the same as shown above?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-02-16