[Vuejs]-Vuejs 2.x – Make a rest api call with an array of objects

0πŸ‘

I suggest using fetch as a modern way to make a request.
Check out examples here https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Body

0πŸ‘

You could install any HTTP client library – Vue alone doesn’t have a built-in client. Axios is often used with Vue.js.

Usage is simple as 1-2-3:

axios.post('/users', personList).then(() => {
   //your code goes here...
});

Leave a comment