【发布时间】:2021-09-22 03:38:58
【问题描述】:
请帮帮我,我一直被这个问题困扰:我在 React Native 上使用 Axios 发出请求 BSCSCAN-API-TESTNET,并且该请求仅在 iOS 中正常工作,但它不适用于Android(403 禁止响应)。
我的网址请求:https://api-testnet.bscscan.com/api?module=account&action=txlist&address=0x400ee0c820144c8bb559ace1ad75e5c13e750334&sort=desc&apikey=P3A263376TPJHKQ5IXUD4VHUNFQKDJB4G5 我更新了 apiKey,所以不要介意。
我的代码:(IOS:ok,android:抛出错误403)
try {
const url =
'https://api-testnet.bscscan.com/api?module=account&action=txlist&address=0x400ee0c820144c8bb559ace1ad75e5c13e750334&sort=desc&apikey=P3A263376TPJHKQ5IXUD4VHUNFQKDJB4G5';
const response = await axios.get(url);
} catch (error) {
throw error;
}
【问题讨论】:
标签: android react-native axios http-status-code-403 bscscan