I am trying to create a file in angular but I can't set the parameter like for the example name
@Injectable({
providedIn: 'root'
})
export class DriveService {
constructor(private http: HttpClient) {
}
token: string = localStorage.getItem('tokenGoogle');
headers = new HttpHeaders()
.set('Authorization', `Bearer ${this.token}`)
.set('Accept', `application/json`)
.set('Content-Type', `application/json`);
creaFileDrive(nome: string): Observable<DriveResultFile> {
return this.http.post<DriveResultFile>('https://www.googleapis.com/upload/drive/v3/files?key=AIzXXXXXXXXXXXXXXXXXX&uploadType=multipart',
{name: 'pata'}, // HERE THE NAME DON'T SET
{headers: this.headers}).pipe(
map(x => {
return x;
})
);
}
}
clearly, this is not my goal
thanks