I want to request to a url using okhttp in another thread (like IO thread) and get Response in the Android main thread, But I don\'t know how to create an
Response
I realise this post is a bit old, but there's a new and more convenient way of doing this now
Observable.fromCallable { client.newCall(Request.Builder().url("your url").build()).execute() }
More info: https://artemzin.com/blog/rxjava-defer-execution-of-function-via-fromcallable/