You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Sasikiran Myadam <sm...@dons.usfca.edu> on 2010/10/21 04:09:18 UTC

an important question how can I read the message body

Hello all,

I am seraching form 2 days on how to handle the post requests. I am building
a server using core compnents. My handle function has HttpRequest request as
an argument. The *main question here is how I can read the message body* and
get the name value pairs of the post request.

http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpRequest.html


Request       = Request-Line
                     *(( general-header
                      | request-header
                      | entity-header ) CRLF)
                     CRLF
                    * [ message-body ]*

Neither the forums nor the documentation helped me. Any help is greatly
appreciated.

Thanks
Sasikrian.

Re: an important question how can I read the message body

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Sasikiran

Do you want to implement a blocking, or non-blocking server?

Check the tutorial to get started 
http://hc.apache.org/httpcomponents-core-ga/tutorial/html/
and the examples http://hc.apache.org/httpcomponents-core-ga/examples.html

The getRequestLine() on a HttpRequest [1] will give you the URL parameters

[1] 
http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpRequest.html#getRequestLine()

cheers
asankha
> Hello all,
>
> I am seraching form 2 days on how to handle the post requests. I am building
> a server using core compnents. My handle function has HttpRequest request as
> an argument. The *main question here is how I can read the message body* and
> get the name value pairs of the post request.
>
> http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpRequest.html
>
>
> Request       = Request-Line
>                       *(( general-header
>                        | request-header
>                        | entity-header ) CRLF)
>                       CRLF
>                      * [ message-body ]*
>
> Neither the forums nor the documentation helped me. Any help is greatly
> appreciated.
>
> Thanks
> Sasikrian.
>
>    


-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





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