resthub/resthub-spring-stack — pull request #84 by bclozel (2012-06-27 16:13:58+00:00)
Title: Simplified HTTP Client API

When dealing with async HTTP, request/response code can be far appart and decoupled.
For me, using an API like Client.Response.jsonDeserialize can be awkward, since you may not know which content-type was used when the request was sent.

### Introducing BodyReaders and BodyWriters

I know, it is JAX-RS like, but this is quite useful.
RESThub's HTTP client supports JSON and XML out-of-the-box. Users can add other BodyWriters/BodyReaders to support other mediaTypes.

### API changes

**Response is no longer an inner class**
```java
import org.resthub.web.Client.Response;
```
is now:
```java
import org.resthub.web.Response;
```

**You don't need to specify the response format to deserialize it**
```java
future.get().jsonDeserialize(User.class);
```
is now:
```java
future.get().getEntity(User.class);
```

### Bugs fixed

JSON BodyReader matches standard json and vendor content-types
> application/json
> application/vnd.atos.v2+json

XMLBodyReader matches standard xml and vendor content-types
> application/xml
> application/vnd.atos.v2+xml