I have an API i need to pull information out of the header and make another call. I've tried a number of approaches, but can't seem to fetch the headers only. There is no other response.
I've tried having it return various Response objects, such as okhttp3 headers, Retrofit headers, HttpHeaders, etc, but getting a EOF at first char.
api:
@POST("api/booking/search")
fun bookFlight(@Body bookFlightDetails: BookFlightDetails): Observable<Response<Headers>>
manager class:
class DataManager(context: AllegiantApplication, private val mApi: RxRestServices) {
fun bookFlight(bookingDetails: BookFlightDetails) : Observable<Response<Headers>>? {
return mApi.bookFlight(bookingDetails)
}
And fetching it with my repo:
fun bookFlight(bookingDetails: BookFlightDetails) {
mDataManager.bookFlight(bookingDetails)
?.subscribeOn(Schedulers.io())
?.observeOn(AndroidSchedulers.mainThread())
?.subscribe({
processHeader(it)
}, {
error -> Log.d("TAG", error.localizedMessage) // <- EOF at 1st char
}
)
}
Can anyone tell me how I need to structure my api calls to get just the header?
processHeaderpls? - Fred