首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Google格式错误或非法请求

Google格式错误或非法请求
EN

Stack Overflow用户
提问于 2015-12-13 21:15:05
回答 1查看 4.2K关注 0票数 1

我发出以下请求:

URI:

代码语言:javascript
复制
https://accounts.google.com/o/oauth2/token      

标题:

代码语言:javascript
复制
content-length  307
content-type    application/x-www-form-urlencoded

身体:

代码语言:javascript
复制
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

我得到的回应是:

代码语言:javascript
复制
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>

请任何人帮我指出https请求中的错误。

谢谢你,Milind

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-14 08:50:34

谢谢你DalmTo。我试过了,但这并没有解决问题。然后,在仔细查看请求的每个部分之后,我看到我的套接字库将HTTP方法作为"GET“发送,尽管我给出了一个身体。有一次我强迫它“张贴”它起作用了!

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34256432

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档