I'm trying to set up OAuth for users of my Rails app to GetPocket (http://getpocket.com).
On Step 2 of the Pocket Authentication docs (http://getpocket.com/developer/docs/authentication), I'm having trouble constructing the exact Faraday request.
The following request works:
Faraday.post('https://getpocket.com/v3/oauth/request', {consumer_key: 'key', redirect_uri: 'localhost:3000'})
But I'd like the response to be in JSON. I'd like to be able to add a "Content-Type":"application/json" header to the request, but all my attempts don't seem to work.
Interestingly, when I do the following, the request fails (it returns a 200 but doesn't return a request token, just a whole HTML page):
conn = Faraday.new('https://getpocket.com/v3/oauth/request')
conn.post('/', {consumer_key: 'key', redirect_uri: 'localhost:3000'})
How do I get my Faraday POST request to the Pocket API to return results in JSON?