使用Android KTOR客户端与搜索查询的呼叫API
我想使用android ktor-client来运行具有查询的API:
这是主要API:https://www.filimo.com/api/api/en/en/v1/movie/movie/movie/movie/list/list/list/tagid- /1000300/text/{query}/sug/on
如何将{query}
传递给请求和ktor?
I want to use the android Ktor-client to run an API that has a query:
This is the Main Api: https://www.filimo.com/api/en/v1/movie/movie/list/tagid/1000300/text/{Query}/sug/on
How can I pass the {Query}
to request with Ktor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是解决方案:
This is the solution:
就像@saeed Noshadi所说,您可以用实际查询替换URL的已知部分,但是当您获得多个查询时,它可能会变得凌乱。
因此,我建议用您的base_url构建URL,然后根据需要在每个API调用中添加残留部分
喜欢 -
like @Saeed Noshadi said, you can replace a known part of your URL with the actual query but it might get messy when you get more than one query to add.
hence I suggest to build the url with your BASE_URL and then add the remains part as needed in each API call
like so -