WordsAPI

FREEMIUM
Verified
Por dpventures | Actualizada 13日前 | Data
Popularidad

9.9 / 10

Latencia

192ms

Nivel de servicio

100%

Health Check

N/A

Volver a todas las conversaciones

retrofit return 404 code while postman get 200

Rapid account: Allhebra
Allhebra
4年前

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?

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios