Socket
Book a DemoInstallSign in
Socket

axios-info

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

axios-info

Grab info from Axios request and response

0.1.0
unpublished
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

axios-info

Grab info from Axios request and response

Usage

const axios = require('axios');
const axiosInfo = require('axios-info');


axios.get('/user?ID=12345')
  .then(function (response) {
    console.log(axiosInfo.status(response));      //  200
    console.log(axiosInfo.statusText(response));  //  'OK'
    console.log(axiosInfo.config(response));      //  axios config object
    console.log(axiosInfo.method(response));      //  'GET'
    console.log(axiosInfo.url(response));         //  '/user?ID=12345'
    console.log(axiosInfo.urlFull(response));     //  'https://example.com/user?ID=12345'
  })
  //                                              //  or if error..
  .catch(function (error) {
    console.log(axiosInfo.status(error));         //  404
    console.log(axiosInfo.statusText(error));     //  'Not Found'
    console.log(axiosInfo.config(error));         //  axios config object
    console.log(axiosInfo.method(error));         //  'GET'
    console.log(axiosInfo.url(error));            //  '/user?ID=12345'
    console.log(axiosInfo.urlFull(error));        //  'https://example.com/user?ID=12345'
  });

Keywords

axios

FAQs

Package last updated on 05 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.