cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to send http post without receiving data

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 9 Feb 2012 11:58:06 +0100

On Wed, Feb 08, 2012 at 05:13:36PM -0600, Preston Van Loon wrote:
> I have set up a successful POST function using the curl easy interface.
> How do I set it up so that only sends the POST data, but does not receive data?

Set up a data receive callback and just eat the data. Or, return a code
to abort the transfer.

> Better yet, how can I set it up so it sends the POST, but doesn't wait around
> to see if it even went through?

Sounds pretty dangerous to me, even if it were possible. How would you
know if the data even reached the remote server without waiting for an
acknowledgment of some kind? You could still use the previous technique
to return an error code in the receive callback to abort the transfer
once the response came through. I can't think of any other reliable
way to ensure that the POST was complete without first waiting for the
response, at least using the easy interface. You might be able to use a
debug callback for that, but that's getting pretty ugly and suffers from
the ack problem I mentioned earlier.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-09