mattupstate/spring-social-foursquare — Issue #8:  java.io.IOException: Attempted read from closed stream
Author: drei01
Created: 2011-11-16 13:38:06+00:00
State: open

I am authenticating Foursquare users using
```buildAuthenticateUrl```
exchanging this for an access token successfully using
```exchangeForAccess```
and creating a new foursquare template
```FoursquareTemplate foursquare = new FoursquareTemplate(Constants.FOURSQUARE_API_KEY, Constants.FOURSQUARE_API_SECRET, accessGrant.getAccessToken());```

This all works fine but when i call ```foursquare.userOperations().getUser();``` I get the following exception.

```org.springframework.web.client.ResourceAccessException: I/O error: Attempted read from closed stream.; nested exception is java.io.IOException: Attempted read from closed stream.
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415)
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213)
at org.springframework.social.foursquare.api.impl.AbstractFoursquareOperations.get(AbstractFoursquareOperations.java:24)```

I can debug through and get the url that the method is calling and paste it into a browser and it works fine. The bug seems to be in the spring RestTemplate but I was wondering if you could shed any light on this and it seems foursquare specific as the FacebookTemplate and TwitterTemplate both work fine.

Great work on the library by the way!