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

curl-and-php

Re: problem with & sign.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 23 May 2003 12:53:26 +0200 (CEST)

On Fri, 23 May 2003, piotr maksymiuk wrote:

> > I don't understand. Why are you using CURLOPT_CUSTOMREQUEST at all for a
> > simple POST?
>
> its not a regular POST, because i do not send any variable-value pairs.

POSTs are data. Any data, not just variable-value pairs.

> the content of the request is xml code, which server receives and parses.
> as far as i know (am i wrong?) i can only accomplish it by using custom
> request.

That is the wrong way of doing it. The customrequest option only replaces the
actual request keyword (the 'GET' or 'POST'), so you'll get the path and
HTTP/1.1 strings appended to your post, which most likely will confuse your
receiving end! ;-)

> it is not 'variable1=value1&variable2=value2' string, but appears that
> either curl or the receiving server treats the & sign as the separator.

Curl has no knowledge about the contents or the format you're using in it.

> btw. customrequest is an answer to some other people, i've see a while ago,
> asking how to solve such problem (sendind different content in http
> request).

In that case those people are wrong too.

> so i guess i'll have to snoop the transmission (which i would start with,
> but can't ATM, so checking the mailing list :) ) to find out whether the
> sign is sent right. and if it is, the problem is a receiver, which i can't
> check too :)

If it isn't sent out, then you know that you don't pass the correct data to
curl.

And again, remove that CUSTOMREQUEST kludge and use POSTFIELDS properly.

> aah, so when i tell curl to send '<blabla> &&& </blabla>', the server will
> receive exactly the same?

Yes.

> no transformations, encoding and stuff? plain text?

No transformations at all. Plain *binary* even.

-- 
 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-23