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

curl-and-php

RE: LibCurl PHP Posting Large XML Problem

From: Mark Spittlehouse <mspittlehouse_at_crashfreeculture.net>
Date: Thu, 19 Feb 2004 12:34:01 -0000

Thanks Daniel, that solved my problem.

-----Original Message-----
From: curl-and-php-bounces_at_cool.haxx.se
[mailto:curl-and-php-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: 19 February 2004 12:20
To: using curl with PHP
Subject: Re: LibCurl PHP Posting Large XML Problem

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