javascript - Are the get and post requests in HTTP and the get and post requests of ajax the same thing?
黄舟
黄舟 2017-06-17 09:15:46
0
3
997

I know that http requests and ajax requests are not the same thing. Ajax requests carry some information than http, so are http's get post request and ajax's get post request not the same thing? God, please give me some advice, please give me some advice.

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(3)
世界只因有你

This thing cannot be compared like this. http is a protocol, and ajax is a way to request data. What ajax sends is an http request, so get and post are the same thing and a way of http request

仅有的幸福

The front-end and back-end interface calls implemented through ajax are based on the http protocol. Essentially, it initiates an http request through the front end to the back end. The ajax get post you call is actually the http get post.
Ajax request carries more information than http? You have confused the two concepts of network communication protocol and asynchronous communication technology. To give an inappropriate example, it is like asking whether "currency" is more valuable than "renminbi"?

伊谢尔伦

http request provides basic capabilities for network interaction. Common http verbs are: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS. Ajax is the abbreviation of "Asynchronous Javascript and XML". As the name suggests, it emphasizes asynchronous acquisition of data, and the return data format is required to be json or XML.

So, ajax is a loose implementation of client-side data requests, using an asynchronous approach to improve user experience. As far as its own concept is concerned, it only focuses on the client side itself (making requests and getting data). http is a set of protocol specifications for the interaction between the client side and the service side, and is the basis for all various Internet technologies built on it (such as RESTful, JSONP, AJAX, etc.).

Another concept that is closely related to http and ajax and is easily confused is RESTful. RESTful focuses on the presentation layer state transformation of "resources". It is an architectural principle, or development method, that requires API interfaces to be provided in a standardized form. , attach specific constraints to instructions such as GET, POST, PUT, and DELETE. For example, GET cannot change server-side data, and PUT and DELETE must be idempotent.

For example, the client uses ajax to initiate a PUT operation. It only issues a request and then asks for the result asynchronously. The specific implementation of ajax can be RESTful (or not), and the final implementation of the PUT operation depends on http. If the request involves cross-domain, the browser may also automatically insert an http OPTIONS query.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!