我可以通过以下方式从 Oauth2 API 获取信息:
token = "Token I get from authenticating my App"
auth = "Bearer " + token
user = HTTParty.get("API Website", :headers => { "Authorization" => auth})
我将如何发布到我的应用程序中生成的 API 内容?我有一个实例变量:
@contact = {"contact": {"name": "John Doe" }}
我试过这个:
token = "Token I get from authenticating my App"
auth = "Bearer " + token
user = HTTParty.get("API Website", :headers => { "Authorization" => auth}, @contact)
无济于事。