You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Rajani Karuturi <ra...@gmail.com> on 2015/01/17 00:38:53 UTC

httpcomponents nio server usage

Hi all,
I am trying to use httpcomponents nio server to handle post request file
uploader.

I am facing two issues:
1. how to parse the request?
I could get the entire data including parameters and file content separated
by boundary. Is there a default parser available so that I could do
request.getParameter("param1"), request.getFile() etc.
Stackoverflow question with sample code:
http://stackoverflow.com/q/27994401/201514

2. How to read the data in chunks?
I couldnt figure out a way to read the data in chunks.
HttpEntity.getContent().read is always returning me null. Whereas,
EntityUtils.toByteArray(entity) is giving the complete data.
stackoverflow question with sample code:
http://stackoverflow.com/q/27994359/201514

looking for any help/suggestions in solving these.

Thanks in advance.

-
Rajani

PS: posting it here as the user list is httpclient-users and not about
server.

Re: httpcomponents nio server usage

Posted by Rajani Karuturi <ra...@gmail.com>.
Thanks oleg. Will try and get back.

-
Rajani.

On Mon, Jan 19, 2015 at 2:47 PM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Sat, 2015-01-17 at 05:08 +0530, Rajani Karuturi wrote:
> > Hi all,
> > I am trying to use httpcomponents nio server to handle post request file
> > uploader.
> >
> > I am facing two issues:
> > 1. how to parse the request?
> > I could get the entire data including parameters and file content
> separated
> > by boundary. Is there a default parser available so that I could do
> > request.getParameter("param1"), request.getFile() etc.
> > Stackoverflow question with sample code:
> > http://stackoverflow.com/q/27994401/201514
> >
> > 2. How to read the data in chunks?
> > I couldnt figure out a way to read the data in chunks.
> > HttpEntity.getContent().read is always returning me null. Whereas,
> > EntityUtils.toByteArray(entity) is giving the complete data.
> > stackoverflow question with sample code:
> > http://stackoverflow.com/q/27994359/201514
> >
> > looking for any help/suggestions in solving these.
> >
> > Thanks in advance.
> >
> > -
> > Rajani
> >
>
> Rajani
>
> Please see my responses on Stackoverflow.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: httpcomponents nio server usage

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sat, 2015-01-17 at 05:08 +0530, Rajani Karuturi wrote:
> Hi all,
> I am trying to use httpcomponents nio server to handle post request file
> uploader.
> 
> I am facing two issues:
> 1. how to parse the request?
> I could get the entire data including parameters and file content separated
> by boundary. Is there a default parser available so that I could do
> request.getParameter("param1"), request.getFile() etc.
> Stackoverflow question with sample code:
> http://stackoverflow.com/q/27994401/201514
> 
> 2. How to read the data in chunks?
> I couldnt figure out a way to read the data in chunks.
> HttpEntity.getContent().read is always returning me null. Whereas,
> EntityUtils.toByteArray(entity) is giving the complete data.
> stackoverflow question with sample code:
> http://stackoverflow.com/q/27994359/201514
> 
> looking for any help/suggestions in solving these.
> 
> Thanks in advance.
> 
> -
> Rajani
> 

Rajani

Please see my responses on Stackoverflow.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org