我正试着从这个地址获取:
server-staging.co/api/v1
使用OKHttp lib。运行以下代码后:
Uri.Builder builder = new Uri.Builder();
builder.scheme("http")
.authority("server-staging.co/api/v1");
requestBuilder = new Request.Builder().url(new URL(builder.build().toString()));
Request request = requestBuilder.build();
Response response = mOkHttpClient.newCall(request)
.execute();
我收到以下警告,我无法解决。
java.net.UnknownHostException:无法解析主机 “server-staging.co%2Fapi%2Fv1”:没有与之关联的地址 主机名