cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Can cURL only POST for SOAP?

From: <man_at_tfhs.net>
Date: Wed, 7 Jun 2006 19:17:37 -0000

you have no way of knowing if the data was received successfully by the
server unless you look at the response (think transparent proxy, etc), and
curl is designed not to send data and disconnect prematurely, but rather,
to request urls, which means get the response data.

1. i have trouble envisioning an app where you dont care if the data was
received.

2. if you dont want to block, spawn a new thread or fork a child, and do
the post from that.

allan

On Wed, Jun 7, 2006, Christopher Bland <themanatuf_at_juno.com> said:

> The code is very simple, I just grabbed it from the web.
>
> CURL *curl;
> CURLcode res;
> struct curl_slist *headers = NULL;
>
> curl = curl_easy_init();
> headers = curl_slist_append(headers, "Content-Type: text/xml");
>
> curl_easy_setopt(curl, CURLOPT_POST, 1);
> curl_easy_setopt(curl, CURLOPT_POSTFIELDS, xml);
> curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
> curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error);
>
> curl_easy_setopt(curl, CURLOPT_PORT, "50927");
> curl_easy_setopt(curl, CURLOPT_URL, "http://localhost/");
> curl_easy_perform(curl)
>
> curl_easy_cleanup(curl);
> curl_slist_free_all(headers);
>
> I send the XML no problem and the server receives it no problem. However it appears curl_easy_perform blocks until it receives something back from the SOAP server. In my particular case I'm sending the server some info that I want it to validate without having to respond to curl.
>
> I was then hoping to get the program to continue so that I could send something else to the server. I have a loop and I don't want to wait for the server's response. I just want to keep sending.
>
> From what I've read this doesn't seem possible. I think I might just send back some dummy ACK message to allow my app to keep looping.
>
> If there are any other thoughts I'm open to criticism. Thanks for the help.
>
>
> ________________________________________________________________________
> Try Juno Platinum for Free! Then, only $9.95/month!
> Unlimited Internet Access with 1GB of Email Storage.
> Visit http://www.juno.com/value to sign up today!
>
>
>
>

-- 
m. allan noah
IT Director, TfHS.net
ph# (804) 355-5489
tf# (866) 724-9722
fx# (804) 355-0477
Received on 2006-06-07