Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请求另外一个url地址的数据应该怎么弄? #3

Closed
txxxtxx opened this issue Aug 5, 2021 · 3 comments
Closed

请求另外一个url地址的数据应该怎么弄? #3

txxxtxx opened this issue Aug 5, 2021 · 3 comments

Comments

@txxxtxx
Copy link

txxxtxx commented Aug 5, 2021

No description provided.

@miaowmiaow
Copy link
Owner

app模块中的App文件设置

private fun initSimpleHttp() { SimpleHttp.setBaseUrl("https://www.wanandroid.com/") }

@marren06
Copy link

app模块中的App文件设置

` private fun initSimpleHttp() { SimpleHttp.setBaseUrl("https://www.wanandroid.com/") }
他的意思是说接口有多个BaseUrl 不是固定一个

@miaowmiaow
Copy link
Owner

app模块中的App文件设置
` private fun initSimpleHttp() { SimpleHttp.setBaseUrl("https://www.wanandroid.com/") }
他的意思是说接口有多个BaseUrl 不是固定一个

你可以通过代码,如下进行请求:
val request = HttpRequest("https://www.baidu.com/")
val response = get(request)

如果以上方式不能满足需求,请创建多个Retrofit。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants