Answers for "mock axios response"

3

how to make request with axios

const axios = require('axios');

async function makeGetRequest() {

  let res = await axios.get('http://webcode.me');

  let data = res.data;
  console.log(data);
}

makeGetRequest();
Posted by: Guest on August-10-2020
0

axios mock parameter

mock.onGet("/users", { params: { searchText: "John" } }).reply(200, {
  users: [{ id: 1, name: "John Smith" }],
});
Posted by: Guest on April-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language