Described a REST client for file upload
@HttpExchange("${google-drive.url}")
public interface GDriveClient {
@PostExchange("/upload/drive/v3/files")
ResponseEntity<GDataOutput> uploadFile(@RequestHeader("Authorization") String authorization,
@RequestBody byte[] data);
}
It works, but the file is downloaded to the root and with a fixed name Untitled
I want it to download to a specific folder and have a name generated in the application
One example shows the following transmission format
curl -X POST -H "Authorization: Bearer ${r}"
-F "metadata={name :'test.txt'};type=application/json;charset=UTF-8"
-F "[email protected];type=text/plain"
https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart
But I don’t understand how I can transfer such a format.
Who has encountered this, tell me how I can transfer metainformation