commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Dever" <jdev...@nortelnetworks.com>
Subject RE: HTTPClient - PostMethod.setRequstBody(File) requires boundari es?
Date Fri, 09 Aug 2002 14:14:14 GMT
The Get Invloved page has some information for, well, getting involved.
http://jakarta.apache.org/site/getinvolved.html
<http://jakarta.apache.org/site/getinvolved.html> 
 
We are all very open here, and really welcome all kinds contributions.  In
your case, you may wish to create a bugzilla account so that you can assign
the bug to yourself and then submit a patch to fix it (as well as any other
comments) for tracking purposes.  Then it would be casually reviewed by all
and applied to the repository.  Frequently patches are submitted for review
a couple of times and are improved upon each time from comments by the
community.
 
You mentioned test cases, in httpclient (and most if not all other projects)
junit test cases are an important part of a patch.
 
About having a seperate MultipartPostMethod for doing a multipart post would
probablly be better off having that functionality in the PostMethod itself.
As for your proposed addParameter method, is a fileName parameter really
required?  It should be possible to get that out of the File object.
 

-----Original Message-----
From: gunnar.ahlberg@ibs.se [mailto:gunnar.ahlberg@ibs.se]
Sent: Friday, August 09, 2002 9:31 AM
To: Jakarta Commons Developers List
Subject: Re: HTTPClient - PostMethod.setRequstBody(File) requires
boundaries?



Wow! How I love the open source community! Thanx, it works perfectly with my
needs, with one small adjustement. 
- I'll add a overloaded method addParameter(String fileName, File file,
String encoding) 

Jeff, would it get added to if we provide a test case? 
I presume that the PostMethod implementation would be merged with
MultipartPostMethod to hide the differences? 
/G 




	Davanum Srinivas <dims@yahoo.com> 


2002-08-09 14:38 
Please respond to "Jakarta Commons Developers List" 


        
        To:        Jakarta Commons Developers List
<commons-dev@jakarta.apache.org> 
        cc:         
        Subject:        Re: HTTPClient - PostMethod.setRequstBody(File)
requires boundaries?



#1: There's code in Apache Axis (for SOAP Attachments) that can be adapted
to do this.
#2: See http://marc.theaimsgroup.com/?t=101139035700002&r=1&w=2

Thanks,
dims  

--- Jeff Dever <jsdever@sympatico.ca> wrote:
> Any comments from anyone in adding multipart form data support to
> HttpClient?  Might be a good 2.1 feature.
> 
> 
> gunnar.ahlberg@ibs.se wrote:
> 
> >
> > Yes, this is what I was hoping for.. to allow multipart messages with
> > file and text input sepearted by a boundary (this is how browser do)
> > Does anyone have any example code for how to do exactly that?
> > The problem with using QueryString is that I have to check for both
> > params and query string on the server side...
> >
> > /G
> >
> >
> >
> >  Jesper de Jong
>    <jespdj@yahoo.com>                  To:        Jakarta Commons
>                                Developers List
>    2002-08-09 13:47            <commons-dev@jakarta.apache.org>
>    Please respond to "Jakarta          cc:
>    Commons Developers List"            Subject:        Re: HTTPClient -
>                                PostMethod.setRequstBody(File) requires
>                                boundaries?
> >
> >
> >
> > Hello Gunnar,
> >
> > If you want to upload a file and possibly other form
> > parameters, the body of the message should be in
> > "application/form-data" format. See RFC 1867
> > (Form-based File Upload in HTML), available at
> > http://www.ietf.org.
> >
> > Jesper de Jong
> > jespdj@yahoo.com
> >
> > --- Jeff Dever <jsdever@sympatico.ca> wrote:
> > > Post parameters are www-url encoded and sent as the
> > > body.  Therefore, a
> > > request body and parameters are mutually exclusive.
> > > Perhaps you are
> > > needing to send a file and a query string?   The
> > > query string is sent as
> > > part of the url and can be used with a response
> > > body.
> > >
> > > setQueryString(String)
> > >     or
> > > setQueryString(NameValuePair[])
> > >
> > >
> > > gunnar.ahlberg@ibs.se wrote:
> > >
> > > >
> > > > Hi,
> > > >
> > > > I'm having trouble with posting files - I want to
> > > mimic the <form>
> > > > <input type="file"> </form> of html.
> > > >
> > > > The example PostXML seemed very promising and
> > > works for basic uploads,
> > > > however, it doesn't use additional parameters. I
> > > need to pass the file
> > > > + a couple of parameters. However, when the body
> > > is set, it's set.
> > > > There is no support for calling setRequestBody and
> > > the add.... This
> > > > only yields IllegalStateExceptions since the body
> > > is already
> > > > generated.
> > > >
> > > > Does this mean that I need to generate the whole
> > > request body with
> > > > boundaries and everything? Seems  a little to low
> > > level for my
> > > > taste...
> > > >
> > > > Thanks for your time. 
> > > > /G
> > > >
> > > > Gunnar Ahlberg
> > > >
> > > > IBS R&D AB                    Telephone: 08-627 45
> > > 01
> > > > Box 1350                               Fax: 08-627
> > > 23 78
> > > > Hemvarnsgatan 8              E-mail:
> > > gunnar.ahlberg@ibs.se
> > > > 171 26 Solna
> > > http://www.ibs.se
> > > > Sweden
> > > >
> > > >
> > >
> > ----------------------------------------------------------------
> > > > --
> > > > To unsubscribe, e-mail:   <
> > > > mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail: <
> > > > mailto:commons-dev-help@jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:commons-dev-help@jakarta.apache.org>
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:commons-dev-help@jakarta.apache.org>
> >
> >
> >
> >
> >    ----------------------------------------------------------------
> > --
> > To unsubscribe, e-mail:   <
> > mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <
> > mailto:commons-dev-help@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
> 


=====
Davanum Srinivas - http://xml.apache.org/~dims/

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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






Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message