Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a new easy constructor, more documentation on how to configure co…

…ntent negotiation
  • Loading branch information...
commit 7863d40d2b215b3f8622029c41d3f39617b6ae59 1 parent 5043285
@jfarcand jfarcand authored
View
10 README.md
@@ -593,4 +593,12 @@ Both client and server supports that RFC, and you can enable it by doing:
.supportedContentType(new MediaType("application","json"))
- will tell the client to re-try using application/json.
+ will tell the client to re-try using application/json.
+
+ You can write your own NegotiationHandler (client) and NegotiationTokenGenerator (server) and then set it on the client and server. For the server, all you need to do is:
+
+ bind(NegotiationTokenGenerator.class).to(NegotiationTokenGeneratorImpl.class);
+
+ where NegotiationTokenGeneratorImpl is your implementation. On the client side you can do:
+
+ WebClient client = new WebAHCClient(new NegotiationHandlerImpl());
View
7 restsimple-client/src/main/java/org/sonatype/restsimple/client/WebAHCClient.java
@@ -98,6 +98,13 @@ public WebAHCClient() {
}
/**
+ * Create a WebAHCClient Client
+ */
+ public WebAHCClient(NegotiationHandler negotiateHandler) {
+ this(new DefaultServiceDefinition(), negotiateHandler);
+ }
+
+ /**
* Create a WebAHCClient Client and populate it using the {@link ServiceDefinition}
*
* @param serviceDefinition a {@link ServiceDefinition}
Please sign in to comment.
Something went wrong with that request. Please try again.