如您所见,由于 Cuttly API,我想缩短我的 URL。因此我发送了一个请求:
axios({
method: "get",
url: "https://cutt.ly/api/api.php",
headers: { "Access-Control-Allow-Origin": "*" },
params: {
key: "MY_KEY",
short: this.state.inputText,
name: ""
}
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
但是当发送时,我收到一个网络错误:
我也使用了跨域标头,但我的问题没有解决。
任何帮助将不胜感激!