So I've created a basic REST API in PHP that returns the following:
$result = array(
"var" => 'testvalue',
);
sendResponse(200, json_encode($result));
How would I get this testvalue
from the JSON using a HTTP POST request in Java?
I'm using the recommended answer from here currently: Sending HTTP POST Request In Java
But it dosn't show how to convert it from this stage:
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream instream = entity.getContent();
To a Java object.
So pretty much how to convert from JSON to a Java object.
Any ideas?