Posts

Showing posts with the label Promises

ReactJS : Fetching Data From API

Image
 In this article, we'll expand our knowledge of React to further horizons. To get started, check out this article .  Why communicate with server? For any application that stores or access data we need communication with server side. This makes the application more scalable and modifiable. Since React is basically a client-side tool, in this article we'll use tomcat as an Application Program Interface.There are several ways to fetch data from the server . Let's check out some of them. We'll see how to get data of employees of a company stored in JSON form from the API. Sending AJAX Request AJAX stands for Asynchronous JavaScript And XML. It is a way of communicating with the server that helps in a more dynamic display of contents of a web application. Lets's see how it works. In my machine, this is the folder structure :  {..path upto tomcat webapps folder..} / webapps / reactApp > employees.json This is how I stored the data in employees.json :  [{ "id...