我目前正在制作一个应用程序,从快速API获取数据。但是我得到了一个错误:
retrofit2.HttpException: HTTP 403 Forbidden我不知道是什么问题,如果有人知道解决方案,请帮助我。
这是我发出的get请求:
interface ApiService {
@GET("product/search?")
suspend fun getResult(@Query("keyword")keyWord: String, @Query("country")country: String, @Query("category")category: String,
@Header("x-rapidapi-key")apiKey: String, @Header("x-rapidapi-host")apiHost: String): List
}发布于 2021-06-08 17:34:16
你有HttpLoggingInterceptor吗?从here检查,以确认所有内容都已正常发送。
如果一切顺利,问题就出在后端。
发布于 2021-06-08 17:39:58
你能提供api合同吗?
也许在路径的末尾有一个不必要的问号。
@GET("product/search?")https://stackoverflow.com/questions/67884888
复制相似问题