Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty9 client POST won't add params

if I add Content-type x-www-form-urlencoded to the header, the parameter is passed but making a trace with wireshark,

I can see the params are attached to the URI and not send as data.


the server complains with 


contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.


if I use other clients I have no problem.


thanks




On June 19, 2013 at 4:31:07 PM, Simone Bordet (sbordet@xxxxxxxxxxx) wrote:

Hi,

On Wed, Jun 19, 2013 at 4:35 PM, Sebastian Gutierrez <scgm11@xxxxxxxxx> wrote:
> Hi,
>
>
>
> I'm migrating from async-http-client to jetty 9 client, I use extensibly
> Async communication, the problem I'm having is that no params are passed on
> POST communication:
>
>
> Example:
>
>
> HttpClient httpclient = new HttpClient();
>
> httpclient.start();
>
>
> httpClient.POST(URIOFRESOURCE).param("param1", JSONSTRING).send(new
> BufferingResponseListener() {
>
> @Override
>
> public void onComplete(Result res) {
>
> result = getContentAsString("UTF-8");
>
> }
>
> });
>
>
>
> the thing is param1 won't get to the server (Server is also Jetty 9, and
> works fine if I use async-http-client or using something like this:

We have a similar test case here:
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java#n227

So there must be something different in your case.
Can you pack a reproducible, autocontained test case that demonstrates
that the server does not receive the parameter ?

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users

Back to the top