Working in Angular 6 I have two HTTP calls that need to execute in series. The first call succeeds and the second call indicates success but never actually makes an HTTP request.
If I break up the two calls and execute them individually they both work. However, when combining them in series the second call never works.
The general idea here is to request a signed URL from the server and upon receipt upload a file to the specified URL.
export class StaticAssetService {
constructor(private httpClient: HttpClient) { }
public uploadAsset(assetType: StaticAssetType, file: File): Observable<any> {
if (file) {
return this.httpClient.get(`${environment.apiURI}/secure/file-upload/getPresignedURLForUpload.json`, {
params: {
assetType: assetType,
originalFileName: file.name
}
}).pipe(map(response => {
return this.httpClient.put(response.signedURL, file, {
headers: new HttpHeaders({'Content-Type': file.type}),
reportProgress: true
})
}));
}
}
}