Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Add a new easy constructor, more documentation on how to configure co…
Browse files Browse the repository at this point in the history
…ntent negotiation
  • Loading branch information
jfarcand committed Jun 28, 2011
1 parent 5043285 commit 7863d40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -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());
Expand Up @@ -97,6 +97,13 @@ public WebAHCClient() {
this(new DefaultServiceDefinition());
}

/**
* Create a WebAHCClient Client
*/
public WebAHCClient(NegotiationHandler negotiateHandler) {
this(new DefaultServiceDefinition(), negotiateHandler);
}

/**
* Create a WebAHCClient Client and populate it using the {@link ServiceDefinition}
*
Expand Down

0 comments on commit 7863d40

Please sign in to comment.