title: google drive api Resumable upload error 400 Parse Error?
body: <p>"Multipart upload" is normal but "Resumable upload" is not.</p>
  
  <p>What is wrong with my "code"?</p>
  
  <p>Does the api need to retransmit the file when the user's network is interrupted?</p>
  
  <p>Will the file be retransmitted from the interruption?</p>
  
  <p>sorry my english is poor</p>
  
  <pre><code>function uploadPostBlob(selectedFile) {
  
    //selectFile is File Object
    var metadata = {
      'name': selectedFile.name, // Filename at Google Drive
      'mimeType': selectedFile.mimeType, // mimeType at Google Drive
      'parents': ['root'], // Folder ID at Google Drive
    };
    var accessToken = gapi.auth.getToken().access_token; // Here gapi is used for retrieving the access token.
    var form = new FormData();
    form.append('metadata', new Blob([JSON.stringify(metadata)], {
      type: 'application/json'
    }));
    form.append('file', selectedFile);
  
    //https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable
    //https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart
  
    fetch('https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable', {
      method: 'POST',
      headers: new Headers({
        'Authorization': 'Bearer ' + accessToken,
        'Content-Type':'application/json; charset=UTF-8'
  
      }),
      body: form,
    }).then((res) =&gt; {
  
      return res.json();
  
    }).then(function(val) {
      console.log(val);
    });
  }
  </code></pre>