Added by Everton Fonseca almost 7 years ago
WtServlet.getInstance().addResource(new WResource() {
@Override
protected void handleRequest(WebRequest request, WebResponse response) throws IOException {
ServletInputStream input = request.getInputStream();
System.out.println("Put int: " + input.available());
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
String dado = null;
while ((dado = reader.readLine()) != null)
{
System.out.println("Dados: " + dado);
}
input.close();
}
}, "/SGIB/index/input");
}
Hey,
The library already parsed the request, I believe. I am not sure if a dynamic resource can be used for this.
But is it not more common/convenient to use a plain servet for a JSON POST API?
Regards,
Koen