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

curl-and-php

Re: Using a string starting with @ in a POST

From: Stephen Pynenburg <spynenburg_at_gmail.com>
Date: Fri, 1 Oct 2010 22:17:01 -0400

Not an expert opinion as far as the C API goes, but a PHP trick that often
works for me... one suggestion off the top of my head would be to try using
double quotes for your post string and then escape the @ with a \ .
-Stephen

On Fri, Oct 1, 2010 at 11:41, <gehasia_at_gmail.com> wrote:

> Hello everybody
>
> i'm coding an application which use the twitpic api.
> I have to send three postdata $var which are
> key = my api key
> message = a message (string)
> media = @/file/to/upload
>
> Great, but my message is often "@twitteruser here is the photo !" (without
> "), and so curl try to find a file and return a
> "failed creating formpost data"
> I tried to urlencode and rawurlendode the $message var, it works, but
> twitpic doesn't decode it correctly
> Is there a way to pass a string starting with @ whithout having curl try to
> process it as a file ?
>
> (see what happen when using urlencode($message) :
> http://twitpic.com/2tngrw
>
> )
>
> Thanks
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2010-10-02