Skip to content

Instantly share code, notes, and snippets.

@realabbas
Created February 9, 2019 13:45
Show Gist options
  • Save realabbas/7969c6f7b5d0cd22befdf94311341fc6 to your computer and use it in GitHub Desktop.
Save realabbas/7969c6f7b5d0cd22befdf94311341fc6 to your computer and use it in GitHub Desktop.
How to use axios in React
import axios from 'axios';
const request = () =>{
axios.get('yourendpoint/query')
.then(function (response){
console.log(response);
})
.catch(function (error){
console.log(error);
});
}
// further program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment