Search code examples
codenameone

RESTfulWebServiceClient find returning 404 error in Codenameone


I've setup a basic java json api for testing. I can access it through a web browser, or with Rest.get("https://guarded-thicket-52527.herokuapp.com/users").jsonContent(). However when I try the following code:

RESTfulWebServiceClient client = new RESTfulWebServiceClient("https://fatidique-croissant-89302.herokuapp.com/users");   
client.find(
    new Query(), rowset -> {  
});

It gives me a 404 error. I haven't started trying to deal with the data, since I get the 404 before I can get to it.


Solution

  • The network monitor shows going to the url fatidique-croissant-89302.herokuapp.com/users/0/29. I've fixed it by adding doing new Query().id("") instead of just new Query() to go directly to the address provided.