【发布时间】:2021-11-16 17:00:25
【问题描述】:
我正在尝试从 https://citizenatlas.dc.gov/newwebservices/locationverifier.asmx/findLocation2 获取开源 API 使用 axios。 我的代码是:
let fetchDCWardUrl = 'https://citizenatlas.dc.gov/newwebservices/locationverifier.asmx/findLocation2?str=2%252015th%2520St%2520NW,%2520Washington,%2520DC%252020024,%2520USA&f=json';
await axios.get(fetchDCWardUrl).then((response) => {
console.log(response);
});
我得到: 当我从邮递员那里点击相同的 URL 或直接点击浏览器的 URL 栏时,我得到了没有任何错误的响应。我也试过用post方法,试过js fetch。
【问题讨论】:
标签: javascript reactjs axios cors