java - How can I retrieve POST data from a Jetty AbstractHandler handle() method? -


searched quite bit, didn't see posts seemed match particular situation/question.

using jetty, have handler class extending org.eclipse.jetty.server.handler.abstracthandler.

the handle method follows:

@override     public void handle(string target, request baserequest, httpservletrequest request, httpservletresponse response)                        throws ioexception, servletexception { 

i need grab post data sent in request, if this:

curl -h "content-type: application/json" -d '{"url":"http://www.example.com"}' http://localhost:8080/

basically, i'm sending post request localhost json dictionary keyed on 'url'. how can retrieve post data?

use standard servlet features available httpservletrequest parameter in handler.handle() method.

the httpservletrequest has 2 methods have access request body.

then use either of 2 using standard java io techniques.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -