I wanted to read my emails from Gmail using an atom feed. Gmail supports it, for the entire procedure you are welcomed to read http://code.google.com/apis/accounts/docs/OAuth2.html however one thing that is missing from the explanation is the final part, i.e. how do I fetch using the access code that I just received.
At the beginning I tried to append ?access_token=YOUR_ACCESS_TOKEN to my oauth address (https://mail.google.com/mail/feed/atom in our case), it didn’t work, I always got 401 access denied.
Guess what, Gmail only supports the Authorization: Bearer <access_token> header so your request should be something like
GET /m8/feeds/contacts/default/full HTTP/1.1 Authorization: Bearer YOUR_ACCESS_TOKEN
Hope it will save you some frustration.