- From: Benoit Mahe <Benoit.Mahe@sophia.inria.fr>
- Date: Fri, 13 Oct 2000 10:03:34 +0200
- To: Sheldon Conaty <sconaty@hotmail.com>
- CC: www-jigsaw@w3.org
I don't see a better way to do that (but may be I forgot something :)
So, we probably need to add such a methot to allow this kind of modification, we'll
probably add that feature in the Request class.
Thank you.
Regards, Benoit.
Sheldon Conaty wrote:
> We are running Jigsaw as a proxy and from both in and out filter points we
> need to read and modify the requests and replies that pass through the
> server. Mostly this is fine as there are APIs in Jigsaw that allow us
> manipulate the data.
>
> The problem we found is when we want to change the POST data in a request
> message. The org.w3c.jigsaw.http.Request class has a getInputStream() that
> we can use to read the incoming data. In our scenario we need to add
> additional data to this request and forward it to the origin server. We
> can't do this as there is no setStream() method on Request. We can modify
> replies as the org.w3c.jigsaw.http.Reply class does have a setStream()
> method.
>
> Having considered a few alternatives we decided to extend the Request class
> directly as follows;
>
> public void setEncodedStream(InputStream is) {
>
> try {
> setContentLength (is.available()) ;
> } catch (IOException ex) {
> }
>
> try {
> setContentType (new
> MimeType("application/x-www-form-urlencoded"));
> } catch (MimeTypeFormatException ignore) {
> }
> this.in = is;
> }
>
> Our questions therefore are;
>
> Is there a better way to do this? and if there is what is it? and if not
> would W3C be interested in including this code (or some equivalent) in
> future releases of Jigsaw?
>
> thanks
>
> stephen
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
--
- Benoît Mahé -------------------------------------------------------
World Wide Web Consortium (W3C)
Architecture domain - Jigsaw Engineer
http://www.w3.org/People/Mahe - bmahe@w3.org
---------------------------------------------------------------------
Received on Friday, 13 October 2000 04:03:40 UTC