Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8105 > unrolled thread

Passing complex data back when using cURL

Started bybill <william@TechServSys.com>
First post2013-01-20 14:42 -0500
Last post2013-01-20 15:01 -0500
Articles 3 — 2 participants

Back to article view | Back to comp.lang.php


Contents

  Passing complex data back when using cURL bill <william@TechServSys.com> - 2013-01-20 14:42 -0500
    Re: Passing complex data back when using cURL Jerry Stuckle <jstucklex@attglobal.net> - 2013-01-20 14:56 -0500
      Re: Passing complex data back when using cURL bill <william@TechServSys.com> - 2013-01-20 15:01 -0500

#8105 — Passing complex data back when using cURL

Frombill <william@TechServSys.com>
Date2013-01-20 14:42 -0500
SubjectPassing complex data back when using cURL
Message-ID<kdhhap$l9f$1@speranza.aioe.org>
I need to take an array that contains arrays and pass it back to 
the script that asked for it using cURL.  I have set 
CURLOPT_RETURNTRANSFER to 1 so the data comes back to a variable 
in the calling program.

The data is alphaneumeric and contains "@" as part of email 
addresses.

I want to have the data back in an array or arrays in the calling 
script.

I looked at serialize, but fear that the null bytes would not 
transfer properly.

I looked at json_encode/decode but wonder about the options.

What would be the best way to move the data from the server back 
to the cURL client ?

-bill

[toc] | [next] | [standalone]


#8106

FromJerry Stuckle <jstucklex@attglobal.net>
Date2013-01-20 14:56 -0500
Message-ID<kdhi5u$gd5$1@dont-email.me>
In reply to#8105
On 1/20/2013 2:42 PM, bill wrote:
> I need to take an array that contains arrays and pass it back to the
> script that asked for it using cURL.  I have set CURLOPT_RETURNTRANSFER
> to 1 so the data comes back to a variable in the calling program.
>
> The data is alphaneumeric and contains "@" as part of email addresses.
>
> I want to have the data back in an array or arrays in the calling script.
>
> I looked at serialize, but fear that the null bytes would not transfer
> properly.
>
> I looked at json_encode/decode but wonder about the options.
>
> What would be the best way to move the data from the server back to the
> cURL client ?
>
> -bill

Generally the best way would be to use json.  You could also do 
something like serialize the data and then base64 encode the data.

Other ways are possible also, but more complicated.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#8107

Frombill <william@TechServSys.com>
Date2013-01-20 15:01 -0500
Message-ID<kdhifb$o8b$1@speranza.aioe.org>
In reply to#8106
On 1/20/2013 2:56 PM, Jerry Stuckle wrote:
> On 1/20/2013 2:42 PM, bill wrote:
>> I need to take an array that contains arrays and pass it back
>> to the
>> script that asked for it using cURL.  I have set
>> CURLOPT_RETURNTRANSFER
>> to 1 so the data comes back to a variable in the calling program.
>>
>> The data is alphaneumeric and contains "@" as part of email
>> addresses.
>>
>> I want to have the data back in an array or arrays in the
>> calling script.
>>
>> I looked at serialize, but fear that the null bytes would not
>> transfer
>> properly.
>>
>> I looked at json_encode/decode but wonder about the options.
>>
>> What would be the best way to move the data from the server
>> back to the
>> cURL client ?
>>
>> -bill
>
> Generally the best way would be to use json.  You could also do
> something like serialize the data and then base64 encode the data.
>
> Other ways are possible also, but more complicated.
>
Thanks Jerry,
simple is good.

bill

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web