2
我正在嘗試獲取curl並從API獲取JSON。包含憑據的URL的請求
curl -XPOST -d "grant_type=password" -d "[email protected]" \
-d "password=admin" "[email protected]:8081/oauth/token"
當我使用終端的一切捲曲工作正常,但與試圖成爲一個取我得到的底部所提及的錯誤消息。
fetch("http://[email protected]:8081/oauth/token", {
credentials: 'include',
body: "grant_type=password&[email protected]&password=admin",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
method: "POST"
}
這是錯誤我得到:
TypeError: http://[email protected]:8081/oauth/token is an url with embedded credentials.
是取指我做錯了?