I have several Requests that depend on each other and must me called in sequence? Can somebody give me an example using AFNetworking and reactive cocoa?
Example:
The method names are clearly made-up but should give you a sense of the form of the code you'd write:
[[self
executeLoginRequest]
flattenMap:^(id transactionId) {
return [[[self
executeUpdateRequest:data withTransactionId:transactionId]
then:^{
return [self executeUploadRequest:jpeg withTransactionId:transactionId];
}]
then:^{
return [self endRequests:transactionId];
}];
}]
We're using -flattenMap:
to take the result of the login request and then make more requests off of it.