Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: axios
node v10.24.1
version:
master
endpoint
share
tweet
const axios = require('axios'); const instance = axios.create({ baseURL: 'http://httpbin.org' }); instance.interceptors.request.use(config => { console.log(instance.getUri(config)); return config; }); instance.interceptors.response.use(response => { console.log(instance.getUri(response.config)); return response; }); instance.request({ url: '/status/200' }).then(response => console.log(response.status));
Created from: https://npm.runkit.com/axios
Loading…
no comments
sign in
to comment