引起:java.lang.IllegalArgumentException:无效的 URL 端口:“*************”

问题描述 投票:0回答:1

这是我在网络模块中的网址

 private const val BASE_URL = "http://localhost:192.168.29.20/api/"

我收到错误了

引起:java.lang.IllegalArgumentException:无效的 URL 端口:“*************”

kotlin android-studio retrofit
1个回答
0
投票

应该是

"http://Your_URL:Your_Port/api/"

可能你想要类似的东西

"http://192.168.29.20:some_number/api/"
其中“some_number”代表您尝试使用的端口。

© www.soinside.com 2019 - 2024. All rights reserved.