javascript - In addition to ajax, what else can be used to call the backend interface from the front end?
仅有的幸福
仅有的幸福 2017-06-30 09:57:52
0
4
1157

The company wants to build a mobile official website and cannot use ajax to call the interface (in order to capture data for others), so what else can be used? ? ?
What does Baidu use to capture data?

仅有的幸福
仅有的幸福

reply all(4)
淡淡烟草味

You can use fetch....
Link description

ringa_lee

It depends on what protocol the interface uses

Some interfaces can also be adjusted using php’s curl

刘奇

You can make a WebSocket middleware and use the middleware to forward the interface. This has several benefits:

  1. No need to repeat requests multiple times, which can speed up browser execution efficiency

  2. The browser has a limit on the number of AJAX requests initiated simultaneously under the same domain name, while WebSocket only requires one connection, and the browser has no limit on the number of WebSocket connections

  3. Using WebSocket, you can not only request server data. When other users operate on data on the server elsewhere, you can also push updated content to all front-end parts that are browsing this page through WebSocket broadcast, allowing data modification and browsing. Instant sync

伊谢尔伦

webservice, websocket-based, page http

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template