发布于 2016-03-12 23:29:52 | 179 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

Retrofit REST 客户端

retrofit 是一个类型安全的 REST 客户端,用于 Android 平台。


Retrofit 2.0.0 正式发布了,retrofit 是一个类型安全的 REST 客户端,用于 Android 平台。。

该版本的重点是提升扩展性,因此包含大量 API 的改动,与上一个版本不兼容。详细的变化请看这里

与 Beta4 版本比较的改进包括:

  • New: RxJavaCallAdapterFactory now supports service methods which return Completable which ignores and discards response bodies, if any.

  • New: RxJavaCallAdapterFactory supports supplying a default Scheduler which will be used for subscribeOn on returned Observable, Single, and Completable instances.

  • New: MoshiConverterFactory supports creating an instance which uses lenient parsing.

  • New: @Part can omit the part name and use OkHttp's MultipartBody.Part type for supplying parts. This lets you customize the headers, name, and filename and provide the part body in a single argument.

  • The BaseUrl interface and support for changeable base URLs was removed. This functionality can be done using an OkHttp interceptor and a sample showcasing it was added.

  • Response.isSuccess() was renamed to Response.isSuccessful() for parity with the name of OkHttp's version of that method.

  • Fix: Throw a more appropriate exception with a message when a resolved url (base URL + relative URL) is malformed.

  • Fix: GsonConverterFactory now honors settings on the Gson instance (like leniency).

  • Fix: ScalarsConverterFactory now supports primitive scalar types in addition to boxed for response body parsing.

  • Fix: Retrofit.callbackExecutor() may now return an executor even when one was not explicitly provided. This allows custom CallAdapter.Factory implementations to use it when triggering callbacks to ensure they happen on the appropriate thread for the platform (e.g., Android).

下载地址:

https://github.com/square/retrofit/releases/tag/parent-2.0.0



历史版本 :
Retrofit 2.3.0 发布,Android 的 REST 客户端
Retrofit 2.1.0 发布,Android 的 REST 客户端
Retrofit 2.0.2 发布,Android 的 REST 客户端
Retrofit 2.0.1 发布,Android 的 REST 客户端
Retrofit 2.0.0 正式发布,Android 的 REST 客户端
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务