cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: LibCurl PHP Posting Large XML Problem

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 19 Feb 2004 13:19:39 +0100 (CET)

On Thu, 19 Feb 2004, Mark Spittlehouse wrote:

> . The Order XML can be posted as an un-encoded string. Using this method,
> there will be no parameters. This method is preferred due to the size
> limitations on ASP pages.

...

> curl_setopt($ch, CURLOPT_TIMEOUT, 10); // times out after 10s

This might be too strict.

> curl_setopt($ch, CURLOPT_POST, 1); // set POST method
> curl_setopt($ch, CURLOPT_POSTFIELDS, "XML=$data"); // add POST fields

...

> And this works just fine for small orders. I need to be able to place
> large xml orders hence I need to use the first method.
>
> Any ideas how to achieve this?

Yeps:

  curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // add POST data

However, you used $data when it was supposed to be "form encoded" so you need
to make sure it is "un-encoded" as described above.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
Received on 2004-02-19