Axios Promise-based HTTP client

Axios , Promise-based HTTP client, can work in the browser and can also be used in node.js.

Function:

  • Create XMLHttpRequest from browser
  • Create http requests from node.js
  • Support Promise API
  • Intercept requests and responses
  • Transform request and response data
  • cancel request
  • Automatically convert JSON data
  • Client support to prevent XSRF attacks

Sample code:

Execute a GET request

 // Make a request for a user

The post Axios Promise-Based HTTP Client first appeared on Lenix Blog .

This article is transferred from https://blog.p2hp.com/archives/10087
This site is only for collection, and the copyright belongs to the original author.