axios | Npm axios
PromisebasedHTTPclientforthebrowserandnode.jsWebsite[1]•Documentation[2]TableofContentsFeaturesMakeXMLHttpRequests[3]fromthebrowserMakehttp[4]requestsfromnode.jsSupportsthePromise[5]APIInterceptrequestandresponseTransformrequestandresponsedataCancelrequestsAutomatictransformsforJSON[6]data🆕Automaticdataobjectserializationtomultipart/form-dataandx-www-form-urlencodedbodyencodingsClientsidesupportforprotectingagainstXSRF[7]BrowserSupportInstallingPackagemanagerUsingnpm:Usingbower:Usingyarn:Usi...
Promise based HTTP client for the browser and node.js
Website[1] • Documentation[2]
Table of Contents Features Make XMLHttpRequests[3] from the browser Make http[4] requests from node.js Supports the Promise[5] API Intercept request and response Transform request and response data Cancel requests Automatic transforms for JSON[6] data 🆕 Automatic data object serialization to multipart/form-data and x-www-form-urlencoded body encodings Client side support for protecting against XSRF[7] Browser Support Installing Package managerUsing npm:
Using bower:
Using yarn:
Using pnpm:
Once the package is installed, you can import the library using import or require approach:
import axios, {isCancel, AxiosError} from axios;You can also use the default export, since the named export is just a re-export from the Axios factory:
import axios from axios; console.log(axios.isCancel(something))...