cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Found out why the 60K request is failing but unsure how to fix it

From: Ralph Mitchell <rmitchell_at_eds.com>
Date: Fri, 02 May 2003 00:27:26 -0500

You probably need to urlencode the XML data, or something like that.

If you've got this (from your original message):

    Char* msg="parm1=fctname&parm2=60kofXMLData..."

then having "&amp;" in the string is going to be a problem, because &amp
looks a lot like &parm2, and so on. This means replacing all
non-alphanumeric chars in the '60kofXMLData' with %xx equivalent.

I don't think libcurl does that for you, right Daniel?

Ralph Mitchell

M D wrote:

> Ok. I found out why it is failing. Not sure how to
> fix it.
>
> In the 60k of XML string there are tag values like
> "<movie>The King &amp; I</movie>"
>
> When the the string hits the server it is truncated to
> "<movie>The King " and it fails with an invalid XML
> error.
>
> The documentation suggests that specifing
> CURLOPT_POSTFIELDSIZE will allow for binary data.
>
> ~~~
>
> I also tried specifying this in the header:
>
> headers = curl_slist_append(headers, "Content-Type:
> text/xml");
> curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER,
> headers);
>
> The server didn't recognize any parms being sent when
> I put that in.
>
> ~~~
>
> Btw, if I replace the "&amp;" with "" it works (but
> this is not what we want)

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-05-02