我使用以下代码:
UriBuilder builder = UriBuilder
.fromPath(Constants.LIVEMAP_BASE_URL_US)
.scheme("http");
return builder.build().toString();它怎么会生成"http:/"而不是"http://"呢?
返回值= http:/livemap-tiles1.waze.com/tiles/internal?lineGeom=...
发布于 2015-05-30 19:41:22
你在滥用fromPath。该方法需要uri路径,但您提供的是主机和路径。
如果您有完整的URI,请使用UriBuilder#fromUri,否则将逐个构建它。
UriBuilder builder = UriBuilder.fromPath("tiles")
.host("livemap-tiles1.waze.com")
.scheme("http")
.path("internal"); // etc.https://stackoverflow.com/questions/30550430
复制相似问题