We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
例如:我需要请求2个接口,第二个接口需要第一个接口得到的返回值作为参数,这样如何实现?
The text was updated successfully, but these errors were encountered:
我也考虑过嵌套请求的问题,不过目前没有什么头绪,暂时只能在第一个结束的时候调用第二个
Sorry, something went wrong.
很简单,用FlatMap:
networkClient.token() // 订阅时请求 token .flatMap(new Func1<String, Observable<Messages>>() { @Override public Observable<Messages> call(String token) { // 根据token,返回 Observable<Messages> return networkClient.messages(); } }) .subscribe(new Action1<Messages>() { @Override public void call(Messages messages) { // 处理消息 } });
No branches or pull requests
例如:我需要请求2个接口,第二个接口需要第一个接口得到的返回值作为参数,这样如何实现?
The text was updated successfully, but these errors were encountered: