gpt4 book ai didi

android - 对带端口的 IP 地址的改造请求

转载 作者:搜寻专家 更新时间:2023-11-01 07:46:56 24 4
gpt4 key购买 nike

我正在使用 Retrofit 解析数据。由于我过去常常给 Retrofit Request 提供 BASE URL 和 END POINTS,所以我不知道如何给 IP ADDRESS 作为 BASE URL。

我想使用这样的 URL: http://xxx.xxx.xx.xxx:xxxx/

有什么建议可以设置我的BASE URL 和END POINT吗?

最佳答案

我使用的改造 2 如下所示。

URL_BASE = http://192.168.1.11:8080

Retrofit retrofit = new Retrofit.Builder()
.client(httpClient)
.baseUrl(URL_BASE + "/")
.addConverterFactory(GsonConverterFactory.create())
.build();

终点:http://192.168.1.11:8080/users

@GET("users")
Call<Response> getUser();

关于android - 对带端口的 IP 地址的改造请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42131639/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com