rlalfo / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

Allow callers to change behavior of url string construction #257

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-http-java-client (e.g. 1.15.0-rc)?
1.17.0-rc

Java environment (e.g. Java 6, Android 2.3, App Engine)?
--

Describe the problem.
Changing behavior of GenericUrl's build() url string construction is very 
difficult due to current design.

How would you expect it to be fixed?

Reduce coupling between GenericUrl and HttpRequest and HttpRequestFactory.  
Allow callers to provide their own URL construction logic by providing an 
interface one conforms to in order to build the appropriate url string.

This would introduce a binary incompatible change.

https://codereview.appspot.com/68230043

Sorry, I was fighting with clirr too much to submit the appropriate clirr 
changes.  I figured after some discussion a different approach might be 
suggested, or perhaps this is not desired.  If and when this is considered for 
inclusion I could include the appropriate clirr changes.

I should also note that UrlEncodeContent is already very easy to override 
behavior of url construction, but I found GenericUrl to be difficult, unless we 
change it to an interface - unless there's something more clever that I wasn't 
thinking about.

Original issue reported on code.google.com by jamie.co...@gmail.com on 24 Feb 2014 at 5:03

GoogleCodeExporter commented 9 years ago
If this approach is accepted or considered, it would invalidate 
http://code.google.com/p/google-http-java-client/issues/detail?id=253 and #253 
be closed.

Original comment by jamie.co...@gmail.com on 24 Feb 2014 at 5:05