cURL --data encoding and limits

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

cURL --data encoding and limits

Laurent Gigon
I'm trying to use cURL instead of include_url in order to trigger Sparkpost API.
It works (Thanks Steve and Steffan) but I've an error when data is
more than 5000 characters and uses specifics encoding.
I need to send about 50 000 characters in data string. Actually I've
also have errors on < > " and }

Is there a specific encoding or process before sending data to cURL ?

Laurent

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: cURL --data encoding and limits

stevepiercy
https://curl.haxx.se/docs/manpage.html#-d

curl url -d <data>
or
curl url -d <field>=<data>

should work.

--steve


On 7/5/18 at 2:24 PM, [hidden email] (Laurent G) pronounced:

> I'm trying to use cURL instead of include_url in order to trigger Sparkpost API.
> It works (Thanks Steve and Steffan) but I've an error when data is
> more than 5000 characters and uses specifics encoding.
> I need to send about 50 000 characters in data string. Actually I've
> also have errors on < > " and }
>
> Is there a specific encoding or process before sending data to cURL ?
>
> Laurent
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: cURL --data encoding and limits

Steffan A. Cline
In reply to this post by Laurent Gigon
Can you email me your example directly? There is no reason either the built in or my drop in should fail.


Thanks,
Steffan Cline
[hidden email]
602-793-0014

> On Jul 5, 2018, at 11:24 AM, Laurent G <[hidden email]> wrote:
>
> I'm trying to use cURL instead of include_url in order to trigger Sparkpost API.
> It works (Thanks Steve and Steffan) but I've an error when data is
> more than 5000 characters and uses specifics encoding.
> I need to send about 50 000 characters in data string. Actually I've
> also have errors on < > " and }
>
> Is there a specific encoding or process before sending data to cURL ?
>
> Laurent
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: cURL --data encoding and limits

Laurent Gigon
Same parsing error with both --data-raw,  --data and --data-urlencode

// HTML email message body
var('SP_body')=include_raw('html_email_body.txt');

shell('curl -v \
-H "Content-Type: application/json" \
-H "Authorization: ' + var('sparkpost_api_key') + '" \
--data-binary  \'{
    "content": {
      "from": "'+ var('SP_from')+ '",
     "reply_to":"'+ var('SP_reply_to')+ '",
      "subject": "'+ var('SP_subject') + '",
      "'+var('SP_html_text')+'": "'+var('SP_body')+'"
    },
    "recipients": [{ "address": "' + var('sp_recipient_address') + '" }]
  }\' https://api.sparkpost.com/api/v1/transmissions');


Laurent

2018-07-05 16:45 GMT-04:00 Steffan Cline <[hidden email]>:

> Can you email me your example directly? There is no reason either the built in or my drop in should fail.
>
>
> Thanks,
> Steffan Cline
> [hidden email]
> 602-793-0014
>
>> On Jul 5, 2018, at 11:24 AM, Laurent G <[hidden email]> wrote:
>>
>> I'm trying to use cURL instead of include_url in order to trigger Sparkpost API.
>> It works (Thanks Steve and Steffan) but I've an error when data is
>> more than 5000 characters and uses specifics encoding.
>> I need to send about 50 000 characters in data string. Actually I've
>> also have errors on < > " and }
>>
>> Is there a specific encoding or process before sending data to cURL ?
>>
>> Laurent
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>