我有多个http请求,但是他们必须合并一个名为“accessToken”的参数,该参数依赖于另一个请求的响应来发送服务器。
例如,我有request1,request2,request3,request4,request5,也许越来越多。这些请求在任何地方,我都不想像这样控制它:
[self.AFRequestManager GET:@"individual reqeust" parameters:allParameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSDictionary *parameters = @{@"accessToken":responseObject[@"data"]};
[self.AFRequestManager GET:@"reqeust1" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
所以,当我逐个发送所有这些请求时,如何控制它们之间的关系?