<div dir="ltr">Thanks, I ended up figuring out how to do the second method you listed. Is there any advantage to one verse the other?</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 4, 2015 at 6:19 PM, Stuart Douglas <span dir="ltr"><<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you just want access to the raw data you have a 2 options:<br>
<br>
HttpServerExchange.getRequestChannel()<br>
HttpServerExchange.getInputStream() (exchange should have startBlocking called, and you need to dispatch to a worker thread so as not to block an IO thread)<br>
<br>
If you want access to parsed form/multipart data then you can use io.undertow.server.handlers.form.EagerFormParsingHandler, and the use exchange.gutAttachment(FormDataParser.FORM_DATA) to get access to the parsed data.<br>
<br>
Stuart<br>
<div><div class="h5"><br>
<br>
----- Original Message -----<br>
> From: "Mike Stefaniak" <<a href="mailto:mstefaniak@choicestream.com">mstefaniak@choicestream.com</a>><br>
> To: <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
> Sent: Friday, 2 January, 2015 10:32:35 AM<br>
> Subject: [undertow-dev] HttpServerExchange post data<br>
><br>
> I can't figure out how to get the content of post data<br>
><br>
> My server start<br>
><br>
> Undertow.builder()<br>
> .addHttpListener(8080, "0.0.0.0")<br>
> .setHandler(Handlers.routing().post("/bid", new BidHandler()))<br>
> .build()<br>
> .start();<br>
><br>
> And the handler class<br>
><br>
> public final class BidHandler implements HttpHandler {<br>
><br>
> @Override<br>
> public void handleRequest(final HttpServerExchange exchange) throws Exception<br>
> {<br>
> ........<br>
> }<br>
> }<br>
><br>
><br>
> If I make a curl request like so<br>
><br>
> curl -H "Content-Type: application/json" -X POST -i -d '{"some": "value"}'<br>
> <a href="http://127.0.0.1:8080/bid" target="_blank">http://127.0.0.1:8080/bid</a><br>
><br>
> It gets to the handler, but I can't figure out to access the post data from<br>
> the request<br>
><br>
> Thanks<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> undertow-dev mailing list<br>
> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>