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

curl-and-php

Re: problem with & sign.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 22 May 2003 17:06:02 +0200 (CEST)

On Thu, 22 May 2003, piotr maksymiuk wrote:

> got a problem while using CURLOPT_CUSTOMREQUEST and using & sign within my
> request:

I don't understand. Why are you using CURLOPT_CUSTOMREQUEST at all for a
simple POST?

> so, everything worked fine till i found out that using '&' in my request
> crashes it :< replacing it with '%26' is no good cause its treated as a
> '%26' string and not a sign code.

There's no magic in curl that treats &-letters special. If the operation
fails due to the presense of this, the problem is likely in your script or in
the receiving end.

Of course, you say you CUSTOMREQUEST so I guess curl is issuing a toally
weird request that might be confusing the server badly.

> is it curls fault?

You can easily check that by snooping on the network when the request is
sent, and check if curl is sending the data or not.

> can i make it not to treat my request as url encoded or sth like that?

curl doesn't care if you url encode it or not. It sends what you tell it to,
no matter how you encode it. The receiver of the data however, may not like
what it gets.

> what shall i do for the above to work?

Check the logs on the server side. :-)

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
Received on 2003-05-22