campaignmonitor/createsend-ruby — pull request #25 by jdennes (2013-04-10 10:02:46+00:00)
Title: Fixed URL encoding issue when refreshing an access token.

When attempting to refresh an OAuth access token using token `12349S4aR+9KsgHfB0adpTYxNA==`, this fails:

```
› curl "https://api.createsend.com/oauth/token" -X POST -d "grant_type=refresh_token&refresh_token=12349S4aR+9KsgHfB0adpTYxNA=="
{"error":"invalid_grant","error_description":"Specified refresh_token was invalid or expired"}%
```

The following call works, because the `refresh_token` value has been URL encoded:

```
› curl "https://api.createsend.com/oauth/token" -X POST -d "grant_type=refresh_token&refresh_token=12349S4aR%2B9KsgHfB0adpTYxNA%3D%3D"
{"access_token":"1234hTlHaFtKu6an8lUG72IxMw==","expires_in":1209600,"refresh_token":"12349S4aR+9KsgHfB0adpTYxNA=="}%
```

The `refresh_token` passed to `CreateSend::CreateSend.refresh_access_token` has now been [escaped correctly](https://github.com/campaignmonitor/createsend-ruby/commit/e71ec3de6bc788a809f5443ebb1505774bef6d0a#L0R80) using `CGI.escape`.