[我正在仪表板上使用React,但是当我尝试PUT
请求时,响应为错误400或401。
消息是:{"code":"missing_params","message":"Your update call does not have any parameter. Atleast one parameter is required."}
但是我在请求中插入了参数,我不明白我在做什么错。
uptdate()
{
var url="https://icgaid.freshdesk.com/api/v2/tickets/65"
axios(url,{method:'put',headers: { 'authorization':'Basic ZHBhbG1hQGljZy5jb20uZ3Q6Z3VhdGU1MDI==','Content-Type':'application/json'},body:{'status':4}}
).then(response => response.json()).then(json => {console.log(json);this.setState({re:json})
})
}
`
对象应该有一个名为data的成员,您有主体,还应该检查API文档,也许您有错字,参数名称可能是错误的。