Oauth 2.0 用于在erlang中访问google api的Oauth2
您好,我正在为oauth2协议编写代码,用于访问google pub/sub api。我的代码如下 方法=员额Oauth 2.0 用于在erlang中访问google api的Oauth2,oauth-2.0,google-api,erlang,grant,Oauth 2.0,Google Api,Erlang,Grant,您好,我正在为oauth2协议编写代码,用于访问google pub/sub api。我的代码如下 方法=员额 URL = "https://www.googleapis.com/oauth2/v1/userinfo", Grant = "grant_type=authorization_code:params:oauth:grant-type:jwt-bearer&assertion=& assertion=JWT_Token ", Header = [{"C
URL = "https://www.googleapis.com/oauth2/v1/userinfo",
Grant = "grant_type=authorization_code:params:oauth:grant-type:jwt-bearer&assertion=&
assertion=JWT_Token ",
Header = [{"Content-Type","application/x-www-form-urlencoded"}],
Body = [Grant],
Type = "application/x-www-form-urlencoded",
Options = [],
httpc:request(Method, {URL, Header, Type, Body}, [], Options).
我在发送http请求时遇到以下错误
Response{ok,{{"HTTP/1.1",404,"Not Found"},
[{"cache-control",
"no-cache, no-store, max-age=0, must-revalidate"},
{"date","Tue, 10 Nov 2015 22:27:36 GMT"},
{"pragma","no-cache"},
{"accept-ranges","none"},
{"server","GSE"},
{"vary","X-Origin"},
{"content-length","9"},
{"content-type","text/html; charset=UTF-8"},
{"expires","Fri, 01 Jan 1990 00:00:00 GMT"},
{"x-content-type-options","nosniff"},
{"x-frame-options","SAMEORIGIN"},
{"x-xss-protection","1; mode=block"},
{"alternate-protocol","443:quic,p=1"},
{"alt-svc","quic=\":443\"; p=\"1\"; ma=604800"}],
"Not Found"}}
我几乎可以肯定我发送的授权值是不正确的。
我不确定要在URL和主机参数中传递什么参数。
请帮忙