我只需要为 following endpoint 执行 @GET但不确定语法,这是我的代码:
public interface GithubService {
String SERVICE_ENDPOINT = "https://api.github.com";
String SERVICE_FUNDS_ENDPOINT = "http://iwg-testapi.azurewebsites.net";
// this works fine
@GET("/users/{login}")
Observable<Github> getUser(@Path("login") String login);
//here is the problem:
@GET("/stem/funds")
Observable<Funds> getFunds(@Path("funds") String login);
}
最佳答案
这不是 RxJava 问题,而是改造问题。
我认为问题出在 GET 注释上,因为您想使用路径参数。
@GET("/stem/{funds}") Observable<Funds> getFunds(@Path("funds")
(请注意,我在资金周围添加了 {},因为我想在路径参数中使用它)
您可能需要查看 Retrofit 文档。
关于java - 如何在android中的RXJava中执行@GET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36957201/