15 Jun 2012 06:37
Calling MailChimp with json in post
Owen Watson <o.m.watson <at> gmail.com>
2012-06-15 04:37:50 GMT
2012-06-15 04:37:50 GMT
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 <at> 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
RSS Feed