Retrofit2 and kotlin

Viewed 993

I'm try to combine Kotlin RxJava and retrofit2.

@GET("/xxxxxxxxxxxx/{id}.json")
fun getHotel(@Part("id") id : String) : Observable<Response<Hotel>>

When I try to call this method (getHotels()):

   var subscription = HotelsFactory.getHotelService((activity.applicationContext as App)
            .client)
        .getHotel(arguments.getInt("id").toString())
        .subscribeOn(Schedulers.computation())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe({response -> showHotels(response)}) 
         {throwable ->       throwable.printStackTrace()}
    mSubscription.add(subscription)

I take this one:

@Part parameters can only be used with multipart encoding.

1 Answers
Related