function token_transport(self, url, access_token, data, method, headers)
access_token=access_token or self.access_token
headers.Authorization="Bearer " .. access_token
local parts=u.parse(url)
parts.query=(parts.query or '') .. "access_token=" .. access_token
url=u.build(parts)
return self:build_request(url, data, method, headers)
end
OAuth = require 'loa'
client = OAuth.new(
"https://accounts.google.com/o/oauth2/auth",
"https://accounts.google.com/o/oauth2/token",
"https://www.googleapis.com/drive/v2",
"Your Client ID",
"Your Client Secret",
token_transport
)