hello. Im having a problem with the client.
Im following the tutorial
http://www.restlet.org/documentation/1.0/tutorial
/////////////////////////////////////////////////////////////////////////////////
// Prepare the request
Request request = new Request(Method.GET, "http://localhost:8182/myuri");
// Ask to the HTTP client connector to handle the call
Client client = new Client(Protocol.HTTP);
Response response = client.handle(request);
if (response.getStatus().isSuccess()) {
// Output the response entity on the JVM console
response.getEntity().write(System.out);
} else if (response.getStatus()
.equals(Status.CLIENT_ERROR_UNAUTHORIZED)) {
// Unauthorized access
System.out
.println("Access authorized by the server, " +
"check your credentials");
} else {
// Unexpected status
System.out.println("An unexpected status was returned: "
+ response.getStatus());
}
////////////////////////////////////////////////////////////////////////////
The problem is that response.getStatus().isSuccess() is true, but
response.getEntity() is always returning null.
and it should not be because if i do a get on http://localhost:8182/myuri with
my web browser it returns content.
any ideas?