I am trying to do same sample request given in "https://developers.google.com/drive/v3/web/multipart-upload".
These is my latest request,
Accept:*/*
Authorization:Bearer <MY_AUTH_TOKEN>
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryFW5LVsbJxkVMM
Origin:http://app.128.199.85.9.nip.io:3000
Referer:http://app.128.199.85.9.nip.io:3000/
The request payload is,
------WebKitFormBoundaryFW5LVsbJxkVMM
Content-Disposition: form-data; name="metadata"
{"name":"file"}
------WebKitFormBoundaryFW5LVsbJxkVMM
Content-Disposition: form-data; name="data"; filename="2.jpg"
Content-Type: image/jpeg
------WebKitFormBoundaryFW5LVsbJxkVMM--
I need to make the Top header Content-type to "multipart/related boundary=". Then in the request payload parts, I need to make the first object have content-type of "application/json; charset=UTF-8". I need to make the second object have content-type of "image/jpeg".
How to do it with $.ajax?
My question is different from others because, I am getting different error. If I just use "multipart/form-data", it errors different. I need to use "multipart/related".