top of page
Search

Using Axios with React

  • Writer: Christina Williams
    Christina Williams
  • Nov 9, 2020
  • 1 min read

ree

React is JavaScript, which can send network (HTTP) requests to the server.


Fetch is a method that sends one simple argument to the path and resource you need to make a request from and then returns a promise that will return a response as soon as the server responds. So, you are "fetching" a request and returning a "promise" from the server that will give you a response, which is in the form of an object.


Axios is a JavaScript library. Axios can be used to make HTTP requests. It is often preferred by web developers over the fetch method because it provides several features not available with the fetch method.


Some of the Axios features include:

- It has the ability to cancel requests

- It can be used to intercept HTTP requests and responses

- It enables client-side protection

-It automatically transforms requests and data

-It has built-in support for download progress


When using Axios, you must install it, for example, with react, you would type in your command line npm install axios.



 
 
 

Recent Posts

See All
Reverse a String Algorithm

There are several ways you can do the Reverse a String Algorithm. For the purpose of this blog, I am going to talk about this algorithm...

 
 
 

Comments


bottom of page