Home  >  Q&A  >  body text

javascript - In addition to ajax, what else can be used to call the backend interface from the front end?

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?

仅有的幸福仅有的幸福2691 days ago1118

reply all(4)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-06-30 09:59:52

    You can use fetch....
    Link description

    reply
    0
  • ringa_lee

    ringa_lee2017-06-30 09:59:52

    It depends on what protocol the interface uses

    Some interfaces can also be adjusted using php’s curl

    reply
    0
  • 怪我咯

    怪我咯2017-06-30 09:59:52

    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

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-06-30 09:59:52

    webservice, websocket-based, page http

    reply
    0
  • Cancelreply