restlet-framework-java
restlet-framework-java copied to clipboard
[Restlet GAE][2.3.6] Getting HTTP Status code 204 instead of 200
For the 1st request, I get the JSON response. From the next request onwards I start getting this log and HTTP Status Code 204, even though the ServerResource is successfully returning a representation. I even ran it in debug mode to verify if my server resources was returning the right repreentation or not.
Log Message that I see
org.restlet.engine.adapter.ServerAdapter commit
WARNING: A response with an unavailable and potentially non empty entity was returned. Ignoring the entity for resource http://localhost:8888/xyz?abc=def
Application class for wiring routes
public Example extends Application {
@Override
public Restlet createInboundRoot() {
router = new Router(getContext());
CorsService corsService = new CorsService();
corsService.setAllowedOrigins( new HashSet<String>(Arrays.asList("http://xyz.com")));
corsService.setAllowedCredentials(true);
getServices().add(corsService);
router.attach("/xyz", XYZ.class);
}
}
Server Resource which handles and returns a JSON Representation
public class XYZ extends ServerResource {
private static final Logger logger = Logger.getLogger("API:Xyz");
@Get(":json")
public Representation handleGetRequest() {
..
return API_RESPONSE.SUCCESS; //Where SUCCESS is a JsonRepresentation
}
}