posted 9 years ago
Question:
1) Is this code requesting a Json object? I'm guessing it is because accept is "application /json"
Invocation generateReport = client.target("http://commerce.com/orders/report")
.queryParam("start", "now - 5 minutes")
.queryParam("end", "now")
.request()
.accept("application/json")
.buildGet();
2)
why is Report.class part of the parameter Is it because in #3 below specifies a responseType? So Report.class is the responseType.
while (true)
{
Report report = generateReport.invoke(Report.class);
renderReport(report);
Thread.sleep(300000);
}
3)
Here's the interface
package javax.ws.rs.client;
public interface Invocation
{
public Response invoke();
public <T> T invoke(Class<T> responseType);
public <T> T invoke(GenericType<T> responseType);
...
}
I'm not too sure about what I'm reading, but I'm guessing the above is the author's message.
Thanks