【发布时间】:2021-06-22 00:40:06
【问题描述】:
我正在使用 Axios 进行 API 调用,我需要在 GET Request 中发送一个字符串数组我如何在参数中添加我的列表(在 URL 中)
【问题讨论】:
标签: javascript react-native api get axios
我正在使用 Axios 进行 API 调用,我需要在 GET Request 中发送一个字符串数组我如何在参数中添加我的列表(在 URL 中)
【问题讨论】:
标签: javascript react-native api get axios
这可能会有所帮助
import axios from 'axios';
axios.get('/api', {
params: {
data: JSON.stringify(data)
}
})
.then(function (response) {
console.log(response);
})
【讨论】:
const response = await axios.get('/api', { ... });