Request/Response/RequestTemplate are now fundamentally based on a byte[] body field.
For Request/RequestTemplate, if a charset is provided, it can be treated as text.
For many users of the library, the change should barely be noticeable, as the methods that
were changed were mostly used internally.
There were some non-backwards-compatible signature changes that require a
major version bump, however.
`Feign.builder()` allows you to specify additional configuration such as how to encode a request.
If any methods in your interface use parameters types besides `String` or `byte[]`, you'll need to configure a non-default `Encoder`.
Here's how to configure JSON encoding (using the `feign-gson` extension):
```json
GitHub github = Feign.builder()
.encoder(new GsonEncoder())
.target(GitHub.class, "https://api.github.com");
```
### Advanced usage and Dagger
#### Dagger
Feign can be directly wired into Dagger which keeps things at compile time and Android friendly. As opposed to exposing builders for config, Feign intends users to embed their config in Dagger.
@ -54,7 +55,8 @@ public final class RequestTemplate implements Serializable {
@@ -54,7 +55,8 @@ public final class RequestTemplate implements Serializable {
@ -68,6 +70,7 @@ public final class RequestTemplate implements Serializable {
@@ -68,6 +70,7 @@ public final class RequestTemplate implements Serializable {
this.url.append(toCopy.url);
this.queries.putAll(toCopy.queries);
this.headers.putAll(toCopy.headers);
this.charset=toCopy.charset;
this.body=toCopy.body;
this.bodyTemplate=toCopy.bodyTemplate;
}
@ -117,7 +120,7 @@ public final class RequestTemplate implements Serializable {
@@ -117,7 +120,7 @@ public final class RequestTemplate implements Serializable {
/* roughly analogous to {@code javax.ws.rs.client.Target.request()}. */
@ -391,18 +394,39 @@ public final class RequestTemplate implements Serializable {
@@ -391,18 +394,39 @@ public final class RequestTemplate implements Serializable {
@ -413,6 +437,7 @@ public final class RequestTemplate implements Serializable {
@@ -413,6 +437,7 @@ public final class RequestTemplate implements Serializable {
@ -426,10 +451,7 @@ public final class RequestTemplate implements Serializable {
@@ -426,10 +451,7 @@ public final class RequestTemplate implements Serializable {
@ -93,7 +93,8 @@ class LBClient extends AbstractLoadBalancerAwareClient<LBClient.RibbonRequest, L
@@ -93,7 +93,8 @@ class LBClient extends AbstractLoadBalancerAwareClient<LBClient.RibbonRequest, L
@ -128,9 +128,10 @@ public class AWSSignatureVersion4 implements Function<RequestTemplate, Request>
@@ -128,9 +128,10 @@ public class AWSSignatureVersion4 implements Function<RequestTemplate, Request>