Answers for "import axios from "axios";"

2

import axios

The correct way to import axios copied from the docs is:

const axios = require('axios').default;
Posted by: Guest on September-29-2021
4

import axios

import axios from "axios";
Posted by: Guest on May-12-2020
3

how to use axios get

const req = async () => {
  const response = await axios.get('https://dog.ceo/api/breeds/list/all')
  console.log(response)
}
req() // Calling this will make a get request and log the response.
Posted by: Guest on December-07-2020
4

axios put

const res = await axios.put('https://httpbin.org/put', { hello: 'world' });

res.data.headers['Content-Type']; // application/json;charset=utf-8
Posted by: Guest on June-16-2020

Browse Popular Code Answers by Language