1
使用Jersey,我希望能够有一个GET请求,这将导致服务器代码在另一个返回json对象的资源上发出HTTP请求。我知道泽西岛的客户端和服务器端apis都是分开的,有什么方法可以将两者结合起来?如何使用java Jersey在资源内创建HTTP请求?
@Path("/helloworld")
public class GetData {
@GET
public String getResource() throws IOException {
String result;
//Insert code to make an http request to localhost/someobject.json and store it in a variable
return result;
}
}