How to send request with POST parameters to Netty?

I am trying to send a request with POST parameters to Netty.

I searched API Netty, Google and here (Stack Overflow)

but didn't find a good way to do it. (This could be my terrible search skill mistake: "(If so, I'm sorry)

Is there any API to do this easily?

Or do I have to do this by coding all the parameters and setting it to my content myself?

Please let me know any good way to do this.


source to share

1 answer

Here's an example of how you will upload the file:

If you don't want to upload the file, just ignore the multipart MIME bit.

Try something like:

HttpRequest httpReq=new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.POST,uri);
String params="a=b&c=d";
ChannelBuffer cb=ChannelBuffers.copiedBuffer(params,Charset.defaultCharset());


See Sending POST Parameters with Netty and Why isn't DefaultHttpDataFactory out of editions?



All Articles