hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Glück <ortwin.glu...@nose.ch>
Subject [RFE] provide request entities in a more abstract way
Date Thu, 26 Feb 2004 09:46:34 GMT
Providing only an InputStream as a request body is not enough. We can 
not automatically repeat such a request since we are unable to reset the 
input stream without buffering it. I suggest we introduce an abstraction 
for the source of request entities such as:

interface RequestEntity {
   /**
    * Provides an input stream of the request entity. The method may be 
called
    * more than once and must provide a virgin stream upon each call.
    */
   InputStream getAsStream();
}

We can then provide convenience classes that implement this interface, 
such as:

* class StringRequestEntity implements RequestEntity

* class FileRequestEntity implements RequestEntity

etc.

What does everybody think about this?

Odi
-- 
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer                 [email] ortwin.glueck@nose.ch
  hardturmstrasse 171               [pgp id]           0x81CF3416
  8005 zürich                       [office]      +41-1-277 57 35
  switzerland                       [fax]         +41-1-277 57 12


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


Mime
View raw message