Hi i am trying to overide the baseUrl from one specific api call and it doesnt seem to work when using @Url as a paraemter to the api method.
Below is my Api class method
@POST
fun getUserDetails(@Body body: request, @Url authUrl : String): Single<Response<ResponseData>>
code that cals and make the request
private fun getApi(): Api {
val gson = GsonBuilder().setLenient().create()
val httpClient = myNetworkHelper.createHttpClient()
val retrofit = Retrofit.Builder()
.baseUrl("http://defaultBaseUrl")
.client(httpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
return retrofit.create(Api::class.java)
}
override fun getUserDetails(someRequestData, "http://dynamic/getuserDetails): Single<Response<ResponseData>> {
return getApi().getUserDetails(body, url)
}
The above results in making a request to this url
http://defaultBaseUrl/http://dynamic/getuserDetails
Instead of:
http://dynamic/getuserDetails