Oauth 2.0 Google API格式错误或请求非法

Oauth 2.0 Google API格式错误或请求非法,oauth-2.0,google-oauth,Oauth 2.0,Google Oauth,我提出以下要求: URI: 标题: content-length 307 content-type application/x-www-form-urlencoded 正文: 我得到的答复是: 400 <!DOCTYPE html> <html lang=en> <meta charset=utf-8> <meta name=viewport content="initial-scale=1, minimum-scale=1, widt

我提出以下要求:

URI:

标题:

content-length  307
content-type    application/x-www-form-urlencoded
正文:

我得到的答复是:

400 <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 400 (Bad Request)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>400.</b> <ins>ThatΓÇÖs an error.</ins>
  <p>Your client has issued a malformed or illegal request.  <ins>ThatΓÇÖs all we know.</ins>
400
错误400(错误请求)!!1.
*{margin:0;padding:0}html,代码{font:15px/22px arial,sans serif}html{background:fff;color:222;padding:15px}body{margin:7%自动0;最大宽度:390px;最小高度:180px;padding:30px 0 15px}>body{background background:url(//www.google.com/images/errors/robot.png)100%5px不重复;padding右侧:205px}p{margin{颜色:{777;文本装饰:无}媒体屏幕和(最大宽度:772px){正文{背景:无;页边顶部:0;最大宽度:无;填充右侧:0}}}徽标{背景:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png)无重复;页边左侧:-5px}@仅媒体屏幕和(最小分辨率:192dpi){徽标{背景:url}(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png)不重复0%0%/100%100%;-moz边框图像:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png)0}@media纯屏幕和(-webkit最小设备像素比:2){logo{背景:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png)不重复;-webkit背景大小:100%100%}}logo{显示:内联块;高度:54px;宽度:150px}
那是个错误。
你的客户发出了一个格式错误或非法的请求。这就是我们所知道的。
请任何人帮我指出https请求中的错误

谢谢,
Milind

谢谢DalmTo。我试过了,但没有解决问题。然后仔细查看请求的每个部分后,我发现我的套接字库以“GET”的形式发送HTTP方法,尽管我给出了一个主体。有一次我强迫它“POST”成功了!

尝试删除作用域授予\类型=授权\代码不需要作用域
client_id=8633333333-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&client_secret=dsfhosgoisdflkjsdfjlkssd&code=4%2skjsdhfsnfklfsjlkfsjlsfdcmMKts1jHnbrAAGls&grant_type=authorization_code&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive
400 <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 400 (Bad Request)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>400.</b> <ins>ThatΓÇÖs an error.</ins>
  <p>Your client has issued a malformed or illegal request.  <ins>ThatΓÇÖs all we know.</ins>