I use dropbox download file API , and i got a token , but it's return 400 bad request error "Error in call to API function "files/download": Must provide HTTP header "Authorization" or URL parameter "authorization"
I follow dropbox api doc , but it cannot work ~""~ How do I fix it ?
this is my code ( angular2 )
downloadFile(fileid){
let headers = new Headers();
headers.append('Authorization', 'Bearer ' + this.accessToken);
headers.append('Dropbox-API-Arg','path:'+ fileid);
return this.http.post('https://content.dropboxapi.com/2/files/download',new RequestOptions({ headers: headers ,responseType:ResponseContentType.ArrayBuffer})).map((res) => {
let arrayBuffer = res.arrayBuffer();
let contentType = res.headers.get('content-type');
return {
fileid: fileid,
blob: new Blob([arrayBuffer], { type: contentType })
};
});