WordsAPI

免费增值
Verified
通过 dpventures | 已更新 5 months ago | Data
人气

9.9 / 10

延迟

176ms

服务等级

100%

返回所有讨论

retrofit return 404 code while postman get 200

avatar
Allhebra
a year ago

I use this code:
@Headers(
"x-rapidapi-key:my-key; " +
"x-rapidapi-host:wordsapiv1.p.rapidapi.com; " +
“Content-Type:application/json”
)
@GET(“words/{target}”)
fun getWord(
@Path(“target”) target: String?
): Observable<Result<Any>?>

fun create(): WordsApiService {
val retrofit = Retrofit.Builder()
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.baseUrl(“https://rapidapi.p.rapidapi.com/”)
.build()
return retrofit.create(WordsApiService::class.java)
}

and get error: retrofit2.adapter.rxjava2.HttpException: HTTP 404 Not Found
but when I use postman I get response with 200 code.
Is there anybody who get success response with retrofit?

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论
打分:4 - 投票:40