Bắt đầu

Thư viện HTTP Client dựa trên Promise dành cho trình duyệt và node.js

Axios là gì?

Axios là một thư viện HTTP Client dựa trên Promise dành cho node.js và trình duyệt. Nó có tính đẳng hình (tức là cùng codebase có thể chạy trong cả trình duyệt và node.js). Ở phía server thì nó sử dụng native module http trong node.js, còn ở phía client (trình duyệt) thì nó sử dụng XMLHttpRequest.

Tính năng

Cài đặt

Sử dụng npm:

$ npm install axios

Sử dụng bower:

$ bower install axios

Sử dụng yarn:

$ yarn add axios

Sử dụng jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

Sử dụng unpkg CDN:

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