Closed GoogleCodeExporter closed 9 years ago
I think I have a better idea. See for example:
https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest
Note how it has a rootUrl, servicePath, and baseUrl, where baseUrl = rootUrl +
servicePath. There are a few features that require us to know the rootUrl and
not just the baseUrl. The most obvious one is Google media uploads, whose URL
is rootUrl + "upload/" + servicePath + resourcePath.
Therefore, I propose we add new methods setRootUrl and setServicePath to
JsonHttpClient.Builder and deprecate setBaseUrl (similarly for getters). For
backwards compatibility, when calling setBaseUrl we should assume that
servicePath is always the last two URL path parts of the baseUrl, and rootUrl
is baseUrl minus servicePath. However, we should not rely on that assumption
in general.
So now to use a local test server, it would be for example:
setRootUrl(new GenericUrl("http://localhost:888")) or
setRootUrl(new GenericUrl("http://test.example.com/something"))
Original comment by yan...@google.com
on 3 May 2012 at 9:36
http://codereview.appspot.com/6258043/
Original comment by rmis...@google.com
on 29 May 2012 at 1:38
Original issue reported on code.google.com by
yan...@google.com
on 3 May 2012 at 12:45