- Update to OkHttp 2.x's native API. If you are using OkHttp you must use version 2.0 or newer (the latest
is 2.2 at time of writing) and you no longer need to use the
okhttp-urlconnection
shim. - New: Allow disabling Simple XML Framework's strict parsing.
- New:
@Header
now accepts aList
or array for a type. - New:
@Field
and@FieldMap
now have options for enabling or disabling URL encoding of names and values. - Fix: Remove query parameters from thread name when running background requests for asynchronous use.
- Update to RxJava 1.0. This comes with the project's 'groupId' change from
com.netflix.rxjava
toio.reactivex
which is why the minor version was bumped.
- Fix: Correctly log
null
request arguments forHEADERS_AND_ARGS
log level.
- New:
RetrofitError
'sgetKind()
now disambiguates the type of error represented. - New:
HEADERS_AND_ARGS
log level displays parameters passed to method invocation along with normal header list. - New:
@Part
and@PartMap
now support specifying theContent-Transfer-Encoding
of their respective values. - New:
@Path
,@Query
, and@QueryMap
now have options for enabling or disabling URL encoding on names (where appropriate) and values. @Header
now accepts all object types, invokingString.valueOf
when neccesary.- Attempting to use a
@Path
replacement block ({name}
) in a query parameter now suggested@Query
in the exception message. - Fix: Correct NPE when
Content-Type
override is specified on requests without a body. - Fix:
WireConverter
now correctly throwsConversionException
on incorrect MIME types for parity withProtoConverter
. - Fix: Include
Content-Type
on AppEngine requests. - Fix: Account for NPE on AppEngine when the response URL was not automatically populated in certain cases.
- Fix:
MockRestAdapter
's RxJava support now correctly schedules work on the HTTP executor, specifically when chaining multiple requests together. - Experimental RxJava support updated for v0.20.
- Fix: Add any explicitly-specified 'Content-Type' header (via annotation or param) to the request even if there is no request body (e.g., DELETE).
- Fix: Include trailing CRLF in multi-part uploads to work around a bug in .NET MVC 4 parsing.
- Fix: Allow
null
mock exception bodies and use the success type from the declared service interface.
- New:
@Streaming
on aResponse
type will skip buffering the body to abyte[]
before delivering. - When using OkHttp, version 1.6.0 or newer (including 2.0.0+) is now required.
- The absence of a response body and an empty body are now differentiated in the log messages.
- Fix: If set, the
RequestInterceptor
is now applied at the time ofObservable
subscription rather than at the time of its creation. - Fix:
Callback
subtypes are now supported when usingMockRestAdapter
. - Fix:
RetrofitError
now contains a useful message indicating the reason for the failure. - Fix: Exceptions thrown when parsing the response type of the interface are now properly propagated.
- Fix: Calling
Response#getBody
whennull
body now correctly returns instead of throwing an NPE. - Experimental RxJava support updated for v0.19.
- The
Content-Type
andContent-Length
headers are no longer automatically added to the header list on theRequest
object. This reverts erroneous behavior added in v1.5.0. CustomClient
implementations should revert to adding these headers based on theTypedInput
body of theRequest
.
- New:
@PartMap
annotation accepts aMap
of key/value pairs for multi-part. - Fix:
MockRestAdpater
uses theErrorHandler
from its parentRestAdapter
. - Experimental RxJava support updated for v0.18 and is now lazily initialized.
- New: Support for AppEngine's URL Fetch HTTP client.
- New: Multipart requests of unknown length are now supported.
- New: HTTP
Content-Type
can be overridden with a method-level or paramter header annotation. - New: Exceptions from malformed interface methods now include detailed information.
- Fix: Support empty HTTP response status reason.
- If an
ErrorHandler
is supplied it will be invoked forCallback
andObservable
methods. - HTTP
PATCH
method usingHttpUrlConnection
is no longer supported. Add the OkHttp jar to your project if you need this behavior. - Custom
Client
implementations should no longer setContent-Type
orContent-Length
headers based on theTypedInput
body of theRequest
. These headers will now be added automatically as part of the standardRequest
header list.
- Fix:
@QueryMap
,@EncodedFieldMap
, and@FieldMap
now correctly detectMap
-based parameter types.
- New:
@Query
and@EncodedQuery
now acceptList
or arrays for multiple values. - New:
@QueryMap
and@EncodedQueryMap
accept aMap
of key/value pairs for query parameters. - New:
@Field
now acceptsList
or arrays for multiple values. - New:
@FieldMap
accepts aMap
of name/value pairs for form URL-encoded request bodies. - New:
Endpoint
replacesServer
as the representation of the remote API root. TheEndpoints
utility class contains factories methods for creating instances.Server
andChangeableServer
are now deprecated. SimpleXmlConverter
andJacksonConverter
now have a default constructor.Response
now includes the URL.- Fix: Hide references to optional classes to prevent over-eager class verifiers from complaining (e.g., Dalvik).
- Fix: Properly detect and reject interfaces which extend from other interfaces.
- New: Converter module for SimpleXML.
- New: Mock module which allows simulating real network behavior for local service interface implementations. See 'mock-github-client' example for a demo.
- New: RxJava
Observable
support! Declare a return type ofObservable<Foo>
on your service interfaces to automatically get an observable for that request. (Experimental API) - Fix: Use
ObjectMapper
's type factory when deserializing (Jackson converter). - Multipart POST requests now stream their individual part bodies.
- Log chunking to 4000 characters now only happens on the Android platform.
- Fix: Respect connection and read timeouts on supplied
OkHttpClient
instances. - Fix: Ensure connection is closed on non-200 responses.
- New: Converter for Wire protocol buffers!
- New: Additional first-party converters for Jackson and Protocol Buffers! These are provided
as separate modules that you can include and pass to
RestAdapter.Builder
'ssetConverter
. - New:
@EncodedPath
and@EncodedQuery
annotations allow provided path and query params that are already URL-encoded. - New:
@PATCH
HTTP method annotation. - Fix: Properly support custom HTTP method annotations in
UrlConnectionClient
. - Fix: Apply
RequestInterceptor
during method invocation rather than at request execution time. - Change
setDebug
tosetLogLevel
onRestAdapter
andRestAdapter.Builder
and provide two levels of logging viaLogLevel
. - Query parameters can now be added in a request interceptor.
- Fix: Ensure
@Headers
-defined headers are correctly added to requests. - Fix: Supply reasonable connection and read timeouts for default clients.
- Fix: Allow passing
null
for a@Part
-annotated argument to remove it from the multipart request body.
- Introduce
RequestInterceptor
to replaceRequestHeaders
. An interceptor provided to theRestAdapter.Builder
will be called for every request and allow setting both headers and additional path parameter replacements. - Add
ErrorHandler
for customizing the exceptions which are thrown when synchronous methods return non-200 error codes. - Properly parse responses which erroneously omit the "Content-Type" header.
- Allow uppercase letters in path replacement identifiers.
- Fix: Static query parameters in the URL are now correctly appended with a separating '?'.
- Fix: Explicitly allow or forbid
null
as a value for method parameters.@Path
- Forbidden@Query
- Allowed@Field
- Allowed@Part
- Forbidden@Body
- Forbidden@Header
- Allowed
- Fix: Correct bad regex behavior on Android.
Initial release.