What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-27 16:00:21
jest axios manual mock
//axios.js const axios = require('axios') module.exports = axios.get //__mocks__/axios.js const axios = require('axios') module.exports = { get: async () => { const url = 'https://jsonplaceholder.typicode.com/posts' const response = await axios... Add solution -
Javascript 2022-02-12 07:25:09
axios api post request
const axios = require('axios'); // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(e... Add solution -
Javascript 2021-11-10 07:07:11
how to use axios get
const axios = require('axios'); // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(e... Add solution -
Other 2021-11-06 22:29:21
headers in axios.get
const axios = require('axios'); // httpbin.org gives you the headers in the response // body `res.data`. // See: https://httpbin.org/#/HTTP_Methods/get_get const res = await axios.get('https://httpbin.org/get', { headers: { 'Test-Header': 'test-val... Add solution -
Javascript 2021-10-20 09:40:05
bytes to string js
const axios = require('axios') function serializeBytes(sty) { const string = JSON.stringify({ data: sty }) const input = Array.from(string) const ouput = input.map((_, i) => string.charCodeAt(i)) return new Uint8Array(ouput) } function deserializ... Add solution