cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Passing spaces to Mailchimp with JSON & Windows

From: Owen Watson <o.m.watson_at_gmail.com>
Date: Wed, 18 Dec 2013 14:31:55 +1300

Many thanks : the suggestion to surround the data with quotes seems to do
the job, not even requiring the cmd /c call.
Daniel: the --data docs seem to imply anything you pass on the commandline
needs to be urlencoded , but what I pass is definitely not so encoded, but
still works.

On 17 December 2013 23:47, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Tue, 17 Dec 2013, Owen Watson wrote:
>
> I'm trying to pass a JSON call to MailChimp via commandline Windows and
>> not
>> having much luck.
>>
>
> I don't think this is much of a curl issue. curl sends what you tell it to
> send so you need to figure out what to send...
>
>
> I'm using curl --insecure -d {JSON call} https://us1.mailchimp.com/
>> list/subscribe In the JSON call it works fine if there's no spaces, as
>> you'd expect, but as soon as you introduce spaces, even if you replace them
>> by + or %20 it falls over.
>>
>
> You need to read up on their API on how the JSON is supposed to look like.
> I think JSON is rarely encoded. Are you possing not using any quotes around
> the data, like in your example shows here?
>
> --
>
> / daniel.haxx.se
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-- 
Owen Watson

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-12-18