WordsAPI

FREEMIUM
Verified
Par dpventures | Mise à jour il y a 5 mois | Data
Popularité

9.9 / 10

Latence

176ms

Niveau de service

100%

Retour à toutes les discussions

retrofit return 404 code while postman get 200

avatar
Allhebra
il y a un an

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?

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires
Note : 4 - Votes : 40