【发布时间】:2014-10-12 06:40:20
【问题描述】:
我正在使用Play Framework,并尝试使用内置的WS 支持发出HTTP 请求。每当我尝试在控制器中发出此 HTTP 请求时,我都会收到此错误
error: cannot find symbol
代码
public static Result foo(){
return async(//ERROR ON THIS LINE FOR `async()`
WS.url(GoogleStrategy.getTokenUrl).post(getTokenUrlParams).map(
new F.Function<WSResponse, Object>() {
@Override
public Object apply(WSResponse wsResponse) throws Throwable {
return ok(wsResponse.asJson());
}
}
)
);
}
这很奇怪,因为在文档中显示的所有示例中,这似乎是做我想做的事情的正确方法。
【问题讨论】:
标签: java web-services playframework playframework-2.0