title: Upload file in json to server
body: <p><strong>Context</strong></p>
  
  <p>I have a page with questions, this has an structure like the following</p>
  
  <pre><code>sections:[{
      section: 1,
      questions:[{
          question: 1,
          attachment: [FormData Object]
          ...
      },
      {
          question: 2,
          attachment: [FormData Object]
          ...
      }]
  }, ...]
  </code></pre>
  
  <p>Each question have an attachment. What I did was to create a <code>FormData</code> object, upload the file into it and add it to the question object. Example:</p>
  
  <pre><code>let formData = new FormData();
  formData.append('file', event.target.files[0])
  question.attachment = formData
  </code></pre>
  
  <p>Everything's fine so far. The problem comes when I try to send it to the server. I doesn't pass the form object to it. This is the code I use to send it:</p>
  
  <pre><code>this.$http.post('my-path', {data: this.sections}, {headers: {'Content-Type': 'multipart/form-data'}, emulateJSON: true})
  </code></pre>
  
  <p>Using <code>emulateJSON: true</code> sends the data but <code>attachment</code> attribute is not contained in the request.</p>
  
  <p>Using <code>headers: {'Content-Type': 'multipart/form-data'}</code> for some reason send a null request.</p>
  
  <p>Is there a way to do something like that and actually works?</p>