How to send content using Netty Http Client?
-
30-10-2019 - |
Question
I'm using Netty Http client to send requests to a http server.
I am re-using the channel and keeping the connection live to reuse it between requests.
My problem is that although the get method works perfectly, I can' manage to send content in put or post. Following is the code I am using but in my server the http request input stream is empty.
Any ideas?
HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.valueOf(method), uri.toASCIIString());
if (payLoad != null) {
request.setContent(ChannelBuffers.wrappedBuffer(payLoad));
}
Note: payload is a bytearray.
Thanks,
Yair
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow