1// Make a request for a user with a given ID
2axios.get('/user?ID=12345')
3 .then(function (response) {
4 console.log(response);
5 })
6 .catch(function (error) {
7 console.log(error);
8 });
9
10// Optionally the request above could also be done as
11axios.get('/user', {
12 params: {
13 ID: 12345
14 }
15 })
16 .then(function (response) {
17 console.log(response);
18 })
19 .catch(function (error) {
20 console.log(error);
21 });