我們正在嘗試使用Graphileon代理功能,但每次都會出現如下錯誤:
我們正在嘗試使用Graphileon代理功能。
{"request"/span>:{"url"/span>:"http://127.0.0. 1:8080/score/api","method":"POST","body":{"state": "*","bucket":[{"name":"Ram","tr1"。 "TR1","TC1":1}]},"錯誤":{"訊息": "Request `body` must be string or plain object(when `json`: true)","code":400}, "code":400}. with Status code 400>
這是我們使用的代碼:
var schemaUrl = "http://localhost:8080/score/api"/span>;
var body = JSON.stringify( {
url: schemaUrl,
method: 'POST'。
body: {
狀態。"*",
bucket:
[
{name: "Ram"/span>, tr1: "TR1", TC1: 1}。
]
}
});
console.log("body =="/span> body)。
$.ajax({
url: "/proxy"/span>,
method: "POST",
data: body
})
你能不能幫幫我,到底缺了什么?
。
uj5u.com熱心網友回復:
body也必須是JSON,所以你需要做的是:
var body = JSON.stringify({
url: schemaUrl,
method: 'POST'。
body: JSON.stringify({
狀態。"*"。
bucket:
[
{name: "Ram"/span>, tr1: "TR1", TC1: 1}。
]
})
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/332399.html
標籤:
