Skip to content

Instantly share code, notes, and snippets.

@naturalwarren
Last active December 2, 2018 19:25
Show Gist options
  • Save naturalwarren/866ac99c5bcfcf421ba31ff5651ad66a to your computer and use it in GitHub Desktop.
Save naturalwarren/866ac99c5bcfcf421ba31ff5651ad66a to your computer and use it in GitHub Desktop.
Demonstrates
val authApi: OAuthApi = Retrofit.newBuilder()
.baseUrl(COINBASE_URL)
.addConverterFactory(MoshiConverterFactory.create(moshi))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build()
.create()
interface OAuthApi {
/**
* Calls onError() in the event that a network error
* (request didn't make it to the server or response didn't make
* it back to the client) occurs.
*/
@POST("token")
fun authToken(@Body body: TokenRequestBody): Single<Response<AccessToken>>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment