我不明白为什么我得到一个无效的数组!
response = Unirest.post "#{@@endpoint}/messages/send.json",
headers:{ "Accept" => "application/json" },
parameters:{
:key => @@apikey,
:message => {
:text => "example text",
:subject => "bla bla",
:from_email => "info@site.com",
:from_name => "site.com",
to: [
{
:email => "myemail@gmail.com",
:name => "myname",
:type => "to"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
我得到这个错误
{"status":"error","code":-2,"name":"ValidationError","message":"Validation error: {\"message\":{\"to\":[\"Please enter an array\"]}}"}
Run Code Online (Sandbox Code Playgroud)
小智 5
to数组不应该
[to]=>
array(
[0]=>array(
[email] => "myemail@gmail.com",
[name] => "myname",
[type] => "to"
)
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2054 次 |
| 最近记录: |