How to post array of data to the server in your Vue app

When you develop the Vue application you will have to post array of data to the REST API url given to you

Suppose you are going to make a invoice with several products as shown in the following HTML code

Now I want to submit this HTML table Server

I have update_products function inside the methods section of the Vue instance as shown in the below. What I am doing here is , I create the payload object array and place the products object inside of the payload and then Payload is passed to the Post method of the Axios as the second parameter.

Once you post the data using Axios, in the REST API server, you can get the pasted parameters with your request object