Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

axios

//axios is like an easy fetch with a lot of more options
// the most simple example is this
import axios from 'axios' //ESmodules
try {
    const response = await axios.get('/myEndpoint');
    console.log(response);
  } catch (error) {
    console.error(error);
  }
// axios has a method for every http method too
axios.get(url, config)
axios.delete(url, config)
axios.post(url, body, config)
axios.put(url, body, config)
axios.patch(url, body, config)
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #axios
ADD COMMENT
Topic
Name
1+4 =