retrofit v2.0.0-beta2 Release Notes
Release Date: 2015-09-28 // over 8 years ago-
- New: Using a response type of
Void
(e.g.,Call<Void>
) will ignore and discard the response body. This can be used when there will be no response body (such as in a 201 response) or whenever the body is not needed.@Head
requests are now forced to use this as their response type. - New:
validateEagerly()
method onRetrofit.Builder
will verify the correctness of all service methods on calls tocreate()
instead of lazily validating on first use. - New:
Converter
is now parameterized over both 'from' and 'to' types with a singleconvert
method.Converter.Factory
is now an abstract class and has factory methods for both request body and response body. - New:
Converter.Factory
andCallAdapter.Factory
now receive the method annotations when being created for a return/response type and the parameter annotations when being created for a parameter type. - New:
callAdapter()
method onRetrofit
allows querying aCallAdapter
for a given type. ThenextCallAdapter()
method allows delegating to anotherCallAdapter
from within aCallAdapter.Factory
. This is useful for composing call adapters to incrementally build up behavior. - New:
requestConverter()
andresponseConverter()
methods onRetrofit
allow querying aConverter
for a given type. - New:
onResponse
method inCallback
now receives theRetrofit
instance. Combined with theresponseConverter()
method onRetrofit
, this provides a way of deserializing an error body onResponse
. See theDeserializeErrorBody
sample for an example. - New: The
MoshiConverterFactory
has been updated for its v1.0.0. - Fix: Using
ResponseBody
for the response type orRequestBody
for a parameter type is now correctly identified. Previously these types would erroneously be passed to the supplied converter. - Fix: The encoding of
@Path
values has been corrected to conform to OkHttp'sHttpUrl
. - Fix: Use form-data content disposition subtype for
@Multipart
. - Fix:
Observable
andSingle
-based execution of requests now behave synchronously (and thus requiressubscribeOn()
for running in the background). - Fix: Correct
GsonConverterFactory
to honor the configuration of theGson
instances (such as not serializing null values, the default).
- New: Using a response type of