在axios请求中,缺少content-type头,方法是OPTIONS而不是POST。这是邮递员的请求: POST https://localhost/apiluxor/api/SignIn HTTP/1.1User-Agent请求: OPTIONS https://localhost/apiluxor/api/SignIn HTTP/1.1
Ho
调用try块2.调用axios . 4.请求解析,但db的产品没有显示在屏幕上。"); console.log("request for getting data recieved"),`http://localhost:5000/api/products/?category=${category}`
: &
所以我有两个简单的函数,第一个函数发出一个api调用,检索100个类别ids并将它们存储在一个数组中。我使用lodash随机选取其中的6个类别ids。第二个函数假设使用这6个唯一的类别is,并在查询字符串中使用它们,以便在第二个函数中进行下6个api调用。 async function getCategoryIds() {
const res = await axios.get('http://jservice.io//api&