Home>Article>Web Front-end> Why doesn't vue use ajax
Why vue does not use ajax but axios:
axios is a Promise-based HTTP client for browsers and nodejs. It is essentially an encapsulation of native XHR. , except that it is an implementation version of Promise, conforms to the latest ES specification, and has the following characteristics:
Create XMLHttpRequest from the browser
Support Promise API
The client supports preventing CSRF
Provides some interfaces for concurrent requests (important, facilitates many operations)
Create http requests from node.js
Intercept requests and responses
Convert requests and Response data
Cancel request
Automatic conversion of JSON data
Recommended tutorial: 《js tutorial》
The above is the detailed content of Why doesn't vue use ajax. For more information, please follow other related articles on the PHP Chinese website!