我試圖在Mailchimp V3列表中使用HTTParty添加合併域,但無法將curl轉換爲HTTParty格式。
捲曲請求格式,是工作的罰款:將curl命令轉換爲httparty
curl --request POST \
--url 'https://usxx.api.mailchimp.com/3.0/lists/17efad7sd4/merge-fields' \
--user '12:d1c1d99dr5000c63f0f73f64b88e852e-xx' \
--header 'content-type: application/json' \
--data '{"name":"FAVORITEJOKE", "type":"text"}' \
--include
Httparty用錯誤的API密鑰丟失
response = HTTParty.post("https://us12.api.mailchimp.com/3.0/lists/17efad7sde/merge-fields",
:body => {
:user => '12:d1c1d99dr5000c63f0f73f64b88e852e-xx',
:data => '{"name":"FAVORITEJOKE", "type":"text"}',
:include => ''
}.to_json,
:headers => { 'Content-Type' => 'application/json' })
格式我也嘗試沒有包括選項,但沒有工作
任何錯誤信息? –