intridea/oauth2 — pull request #126 by tagCincy (2013-01-16 18:13:16+00:00)
Title: Handle url query response with text/plain Content Type

IBM's Smartcloud for Social Business [OAuth 2.0 Implementation](http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Social+Business+Toolkit+documentation#action=openDocument&res_title=OAuth_2.0_APIs_for_web_server_flow_sbt&content=pdcontent) returns the access token response as a query string but with a content type of 'text/plain'.

A minor change to check a plain text result to see if it is a query:

```ruby
if @content_type.eql?('text/plain')
@content_type = response.body.match(/([a-zA-Z0-9_]+\=[a-zA-Z0-9_]+\&*)+/) ? 'application/x-www-form-urlencoded' : 'text/plain'
else
@content_type
end
```
This will allow for similar implementations to parse the response correctly.