hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Dever <jsde...@sympatico.ca>
Subject Re: Moving addParameter in HttpMethod interface
Date Fri, 03 Jan 2003 09:09:54 GMT
Hey Richard,

Only Post has "parameters".  These are distinct from "query arguments".
  Parameters are URL encoded and sent in the request body where query
arguments are URL encoded and sent as part of the request line.

So parameters do not belong in the base class, but only in the
specialized classes that actually use them.

-jsd


Richard Dallaway wrote:

> I was wondering if anyone else would find this useful (or if it's just 
> me)...
>
> I'm considering offering some diffs to make 
> addParameter(String,String) available in HttpMethod.  The thinking 
> being that the interface for adding parameters to a request would be 
> easier to use (more consistent, simpler).  E.g., you could say:
>
> HttpMethod method = new GetMethod(whatever);
> or
> HttpMethod method = new PostMethod(whatever);
>
> ...and then do...
>
> method.addParameter("foo", "blah");
>
> ..in both cases.
>
> At the moment if you find out you need to switch from GET to POST (and 
> yes, it has happened to me), then you need to rejigg the way 
> parameters are set up.  Obviously it's not a big deal, but I just felt 
> it's something that could be easier for the user.
>
> For a GetMethod addParameter() would have to play nicely with 
> setQueryString() -- I was thinking addParameter would append to the 
> query string.
>
> Would something like that be useful or is it insane?
>
> Cheers
> Richard
>
>
> -- 
> To unsubscribe, e-mail:   
> <mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:commons-httpclient-dev-help@jakarta.apache.org>
>
>



Mime
View raw message