You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Brijesh Deo <bd...@SonicWALL.com> on 2009/06/02 13:38:35 UTC

how to save the Entity from a HttpRequest into a database table?

Hi,

 

I am using the HttpCore components to create a Reverse Proxy Http
Server. I have a requirement where I should be able to capture an
HttpRequest for a POST request which is being submitted to a backend
server X and save the POST Data into a database table. Later, I want to
read the saved POST data from the database and create a new HttpPost
object with it and apply that HttpPost to another server Y using an
HttpClient instance. I am using HttpClient 4.0 instance to interface
with the backend servers in my Reverse proxy application.

 

For a form submit POST or a multipart POST Request, how do I save the
Non-repeatable (streaming) or a repeatable Entity from the HttpRequest
object into the database, so that I can create multiple HttpPost objects
populated with the saved Entity data (repeatable)? 

 

Can the classes org.apache.http.impl.entity.EntitySerializer and
org.apache.http.impl.entity.EntityDeserializer be extended to solve this
problem? Or is there any other better and efficient way to achieve this?

 

Thanks,

Brijesh

 


Re: how to save the Entity from a HttpRequest into a database table?

Posted by Ortwin Glück <od...@odi.ch>.
Brijesh,

Please read

http://hc.apache.org/mail.html

You may have more luck on the user list. But as this question seems more
generally related to Java than to HttpComponents specifically, I suggest you use
other resources.

All I can say here is: obtain the entity (stream) and store it in a BLOB.

Cheers,

Ortwin

Brijesh Deo wrote:
> Hi,
> 
>  
> 
> I am using the HttpCore components to create a Reverse Proxy Http
> Server. I have a requirement where I should be able to capture an
> HttpRequest for a POST request which is being submitted to a backend
> server X and save the POST Data into a database table. Later, I want to
> read the saved POST data from the database and create a new HttpPost
> object with it and apply that HttpPost to another server Y using an
> HttpClient instance. I am using HttpClient 4.0 instance to interface
> with the backend servers in my Reverse proxy application.
> 
>  
> 
> For a form submit POST or a multipart POST Request, how do I save the
> Non-repeatable (streaming) or a repeatable Entity from the HttpRequest
> object into the database, so that I can create multiple HttpPost objects
> populated with the saved Entity data (repeatable)? 
> 
>  
> 
> Can the classes org.apache.http.impl.entity.EntitySerializer and
> org.apache.http.impl.entity.EntityDeserializer be extended to solve this
> problem? Or is there any other better and efficient way to achieve this?
> 
>  
> 
> Thanks,
> 
> Brijesh
> 
>  
> 
> 

-- 
[web]  http://www.odi.ch/
[blog] http://www.odi.ch/weblog/
[pgp]  key 0x81CF3416
       finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416

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