Tag:fetch

  • Traditional AJAX is dead, fetch is forever

    Time:2020-1-13

    Forgive me for being a title party. Ajax will not die. Traditional Ajax refers to XMLHttpRequest (XHR),FutureIt has now been replaced by fetch. Recently, the data products of Alibaba’s 10 million level PV are all produced by jQuery$.ajaxMigrate toFetch, it has been running very stable since it was launched for more than one month. The […]

  • Choose an Ajax / HTTP Library

    Time:2019-12-29

    Using JavaScript for development can never get around the network. At present, the main network use scenarios are as follows: AJAX (browser) HTTP client (server) Of course, if you are developing an isomorphic / universal application, you may need something that can handle both the browser and the server side. Anyway, use it directlyXMLHttpRequestIt’s very […]

  • Ajax fetch and Axios (continuously updated…)

    Time:2019-12-9

    Ajax fetch and Axios (continuously updated…) Sorting out knowledge points AJAX is not the specification of JavaScript, it is just an abbreviation of “invention” of a friend: asynchronous JavaScript and XML, which means to execute asynchronous network requests with JavaScript. Javascript code is executed by single thread. Due to this “defect”, all network operations and […]

  • Fetch use, AJAX alternative

    Time:2019-11-8

    Fetch introduction Fetch provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses. It also provides a global fetch () method, which provides a simple and reasonable way to obtain resources asynchronously across the network. This functionality was previously implemented using XMLHttpRequest, and fetch provides a better […]

  • How to request data asynchronously in react’s hook

    Time:2019-10-30

    How to request data in react’s hook How to fetch data with react hooks? In this tutorial, I want to show you how to fetch data in React with Hooks by using the state and effect hooks. We will use the widely known Hacker News API to fetch popular articles from the tech world. You […]

  • Fetch Polyfill compatible with IE6

    Time:2019-10-18

    After the react community got up, it didn’t meet the current Ajax solution and made a fetch. Fetches are only supported in some very new browsers, while fetches on GitHub are compatible with IE8 at most, and they are extremely troublesome. A lot of Polyfill needs to be installed to run. So I made a […]

  • [note] the body data server can’t get the request of weex post

    Time:2019-10-16

    var stream = weex.requireModule(‘stream’) For the request of weex post, the server can’t get the parameters. Before that, it was organized in the following way. It can’t get the data all the time, and it will also prompt that the data request is successful. //JSON.stringify var body = JSON.stringify({ loginName:this.userName, password:this.userPassword, }); It’s said on […]

  • Fetch Polyfill release 0.02

    Time:2019-10-14

    Avalon’s official AJAX library fetch Polyfill has released version 0.02 to fix many BUGs. https://github.com/RubyLouvre… Usage example avalon.fetch(‘/getAjax?aaa=1&&bb=2’,{ method: ‘GET’ }).then(function(a){ return a.json() }).then(function(a){ console.log(a) }) avalon.fetch(‘/postAJax’, { method: ‘POST’, headers: { ‘Accept’: ‘application/json’, ‘Content-Type’: ‘application/json’, }, body: JSON.stringify({ firstParam: ‘yourValue’, secondParam: ‘yourOtherValue’, }) }).then(function(a){ return a.json() }).then(function(a){ console.log(a) }) function toQueryString(obj) { return obj […]

  • Front-end fetch communication

    Time:2019-10-9

    Abstracts from this article to: please call me HR With the development of front-end asynchronism, the writing of XHR is not conducive to Front-end asynchronous Promise callback. Moreover, it is very complex to write. The fetch API was originally proposed in SW (Service Workers), but later, when it feels useful, it is mounted under the […]

  • Streaming network request library compatible with small programs

    Time:2019-10-2

    This project is subordinate to the author’s web development introductory and best practices front-end open source project series. If you don’t know the HTTP protocol and specification yet, read the article “HTTP Foundation and Change”. If the recommended reading for REST is not yet available, it will be from the interface design guide and the […]

  • The sails framework communicates using fetch. JS

    Time:2019-9-8

    JavaScript uses XMLHttpRequest (XHR) to execute asynchronous requests, which has existed for a long time. It’s useful, but it’s not the best API. It does not conform to the principle of separation of duties in design. It mixes input, output and state tracked by events into an object. Moreover, the event-based model does not match […]

  • Fetch usage, Ajax alternative

    Time:2019-8-17

    Introduction to fetch Fetch provides a JavaScript interface for accessing and manipulating parts of an HTTP pipeline, such as requests and responses. It also provides a global fetch () method, which provides a simple and reasonable way to obtain resources asynchronously across the network. This functionality was previously implemented using XMLHttpRequest, and Fetch provides a […]