When you are reading the title, well it seems to be a really easy task to be able to do a POST request with some parameters sent along…
Well it is easy, but man it took me long to actually find this out. There is a Restlet documentation but it lacks a LOT of simple examples for a quickstart.
So, here in this first post of the Restlet serie (I’m sure I will have more to cover) I will show you how to do so…
Here I am getting back the response as a JSON string.
// this is if your device doesn't support IPV6
ClientResource clientResource = new ClientResource(Method.POST, YOUR_URL);
Form form = new Form();
Representation entity = clientResource.post(form);
json = new JsonRepresentation(entity).getJsonObject();
catch (JSONException e)
catch (IOException e)
Another tip, be sure you have an internet connection if you using the android emulator, and if you want to use a proxy check this other post.