title: sending vuejs data post request as array of ints instead of strings
body: <p>I have 2 input boxes for <code>weights</code> and <code>values</code>, and I can then click a button to automatically create more. This part is working fine.</p>
  
  <p>The problem now is that the server expects a JSON formdata request containing array of ints, rather than strings.</p>
  
  <p>This is how the postdata should look like:</p>
  
  <pre><code>{"stuff": {"weights": [2, 5, 3], "values": [654, 23, 3]}}
  </code></pre>
  
  <p>This is what it ends up looking like:</p>
  
  <pre><code>{"stuff": {"weights": ["2", "5", "3"], "values": ["654", "23", "3"]}}
  </code></pre>
  
  <p>I have tried to search how to set data array type to int, how to save v-model as int, etc.</p>
  
  <p>I believe this is all the relevant code:</p>
  
  <pre><code>&lt;template&gt;
  ..
  
  &lt;div v-for="(weight, index) in weights"&gt;
    &lt;div&gt;
      &lt;label for="w"&gt;weight:&lt;/label&gt;
      &lt;input v-model="weights[index]"&gt;
      &lt;label for="v"&gt;value:&lt;/label&gt;
      &lt;input v-model="values[index]"&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  ..
  &lt;/template&gt;
  
  &lt;script&gt;
  export default {
    data () {
      return {
        weights: [],
        values: []
      }
    },
    methods: {
      solve: function () {
        var formData = {
          stuff: {
            weights: this.weights,
            values: this.values
          }
        }
        axios.post('http://localhost:8000/my/api/url', formData).then(response =&gt; {
          console.log(response)
        }).catch(e =&gt; {
          console.log(e)
        })
      },
    ...
  &lt;/script&gt;
  </code></pre>