在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):JakeWharton/retrofit2-kotlin-coroutines-adapter开源软件地址(OpenSource Url):https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter开源编程语言(OpenSource Language):Kotlin 63.3%开源软件介绍(OpenSource Introduction):Kotlin Coroutine Adapter (DEPRECATED)A Retrofit 2 This library is deprecated. Please migrate to Retrofit 2.6.0 or newer and its built-in UsageAdd val retrofit = Retrofit.Builder()
.baseUrl("https://example.com/")
.addCallAdapterFactory(CoroutineCallAdapterFactory())
.build() Your service methods can now use interface MyService {
@GET("/user")
fun getUser(): Deferred<User>
// or
@GET("/user")
fun getUser(): Deferred<Response<User>>
} DownloadIf you are using Kotlin 1.3, download the latest JAR or grab via Maven: <dependency>
<groupId>com.jakewharton.retrofit</groupId>
<artifactId>retrofit2-kotlin-coroutines-adapter</artifactId>
<version>0.9.2</version>
</dependency> or Gradle: implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2' If you are using Kotlin pre-1.3 and experimental coroutines, download its latest JAR or grab via Maven: <dependency>
<groupId>com.jakewharton.retrofit</groupId>
<artifactId>retrofit2-kotlin-coroutines-experimental-adapter</artifactId>
<version>1.0.0</version>
</dependency> or Gradle: implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-experimental-adapter:1.0.0' Snapshots of the development version are available in Sonatype's License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论