簡體   English   中英

錯誤請求錯誤:使用 axios 放置的 React js 中的 400

[英]Bad Request error: 400 in React js using axios put

我正在儀表板中使用 react js,但是當我嘗試執行 PUT 請求時,響應是錯誤 400 或 401,消息是:

{"code":"missing_params","message":"Your update call does not have any parameter. At least one parameter is required."}

但是,我在請求中添加了參數,我不明白我做錯了什么?

update() {

    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})})
}

object 應該有一個名為 data 的成員,你有 body,你也應該查看 API 文檔,可能你有錯字,參數名稱可能是錯誤的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM