Let say I have code like that:
this.apiService.getUrlForPhoto('photo1')
.switchMap((url) => {
return this.apiService.uploadPhotoToProvidedUrl(url);
})
.switchMap((response) => {
return this.apiService.confirmPhotoUpload(confirmationToken);
})
.subscribe((response) => {
if (response.confirmed) {
console.log('Success');
}
});
First is http get which returns url where I can post new photo, Second is http put where I have to upload photo, Third is http post where I have to confirm that photo was uploaded to that url.
My question is it is possible to pass url to second switchMap? At second switchMap I have response from uploadPhotoToProviderdUrl method but how can I get response from previous method?