New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flexible-axios

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flexible-axios

A library of http request based on axios.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

flexible-axios

A library of http request based on axios that supports the browser and node.js.

Install

Using unpkg CDN

<script src="https://unpkg.com/flexible-axios/dist/index.min.js"></script>

Using npm

npm install flexible-axios --save

Usage

CommonJS usage

const flexibleAxios = require('flexible-axios')

Method

Get request

flexibleAxios.get(url, config)

  • {String} url => request url.(required)
  • {Object} config => request config.(optional). Including headers|timeout, etc. Default value is null, further information can be queried related document https://axios-http.com/docs/req_config

Post request

flexibleAxios.post(url, data, config)

  • {String} url => request url.(required)
  • {Object} data => request data.(optional). Default value is null.
  • {Object} config => request config.(optional). Including headers|timeout, etc. Default value is null, further information can be queried related document https://axios-http.com/docs/req_config
Notice

Post request set default Content-Type is 'application/json'. If you want to rewrite Content-Type, let's see it:

flexibleAxios.post(url, data, {
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
})

Upload file Method(Specail instance of post method)

flexibleAxios.uploadFile(url, formData)

  • {String} url => request url.(required)
  • {Object} formData => FormData object, support binary file and other key-value data. You can use native FormData in the browser environment, use form-data module in nodejs environment.(required)

Set http header key

flexibleAxios.setHeader(key, value)

  • {String} key => key name.(required)
  • {String} value => value.(required)

License

flexible-axios is MIT licensed.

Keywords

FAQs

Package last updated on 06 May 2021

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc