【发布时间】:2020-01-04 03:55:27
【问题描述】:
我正在尝试使用 HTTParty Rails gem 将数据发布到标准 VoilaNorbert search API endpoint:
response = HTTParty.post(
'https://api.voilanorbert.com/2018-01-08/search/name',
query: {
'name': 'Elon Musk',
'domain': 'https://www.tesla.com/'
},
headers: {
'Content-Type': 'application/json',
'Authorization': VOILANORBERT_API_TOKEN
}
)
但是,当我尝试这个简单的请求时,我得到了响应:
=> {"name"=>["This field is required."]}
我的理解是上面的查询块应该传递名称字段,在本例中是“Elon Musk”。
我在这里错过了什么?
【问题讨论】: