cURL / Mailing Lists / curl-users / Single Mail

curl-users

Calling MailChimp with json in post

From: Owen Watson <o.m.watson_at_gmail.com>
Date: Fri, 15 Jun 2012 16:37:50 +1200

Having a bit of trouble talking to MailChimp with its json option.

C:\Windows\system32>curl.exe --data-urlencode
{"apikey":"XXXX","id":"YYYY","email_address":"owen_at_junk.com"}
http://us2.api.mailchimp.com/1.3/?method=listSubscribe
gets this back:
Warning: Couldn't read data from file
Warning: "{apikey:XXXX,id:YYYY,email_addr
Warning: ess:owen_at_junk.com}", this makes an empty POST.
{"error":"You must specify a apikey value for the listSubscribe
method","code":-90}

I assume that the last line comes back from MailChimp, but I don't
think it's being sent the right data.
The --data-urlencode man explanation is a little unclear; it talks
about no @ being in the url, but I though that was the whole point of
urlencoding?
All help gratefully received.
curl 7.26.0

-- 
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 2012-06-15