Problems with Rest API Post request to upload files to Google Drive

I have tried almost everything but the query either brings error or the file uploads as empty file on google drive. Right now I am using Binary in the body, I also tried Raw and Form-data and nothing seems to work. I am new to API, so I want to know how usually should a post request look like?
this is what I am passing right now

{{ {...fileInput.files[0], data: fileInput.value[0]} }}

and it brings back an error message:
"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Object"

Would like to get any tips, thank you <3

1 Like

Hey @Gudrun_Stella_Agustsdottir based on that error, the endpoint is likely not expecting the entire file object that you are sending. Can you try only sending the data like described in this post?

ie: only sending fileInput.value[0]