【问题标题】:How add SQL parameter in OAuth 2.0 Playground with FusioneTables Scope如何使用 FusioneTables Scope 在 OAuth 2.0 Playground 中添加 SQL 参数
【发布时间】:2012-11-19 15:04:47
【问题描述】:

OAuth 2.0 Playground

可以测试 Oauth 的每个范围。 我试过 https://www.googleapis.com/auth/fusiontables 。 一种可能的操作是“SQL QUERY”。

但是,我不知道如何插入 SQL 参数。 如果我在“添加标题”中添加它,这就是回复:

Request / Response

POST /fusiontables/v1/query HTTP/1.1
Host: www.googleapis.com
Content-length: 0
Content-type: application/json
Authorization: OAuth ya29.AHES6ZSEoq_cukM3HJmIETXNB5CN4xD1VhUVxhANuYTrLlo7juxMow
Sql: insert into 1d8SL_beOD82al66Xnpb-juHYq8b4WW9m6ORNzsM (Text) values ('casa')
HTTP/1.1 400 Bad Request
Content-length: 249
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
X-google-cache-control: remote-fetch
-content-encoding: gzip
Server: GSE
Reason: Bad Request
Via: HTTP/1.1 GWA
Cache-control: private, max-age=0
Date: Mon, 19 Nov 2012 14:21:33 GMT
X-frame-options: SAMEORIGIN
Content-type: application/json; charset=UTF-8
Expires: Mon, 19 Nov 2012 14:21:33 GMT
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Required parameter: sql",
    "locationType": "parameter",
    "location": "sql"
   }
  ],
  "code": 400,
  "message": "Required parameter: sql"
 }
}

有什么想法吗?

【问题讨论】:

    标签: google-fusion-tables oauth2-playground


    【解决方案1】:

    sql 参数是 URL 参数,因此是请求 URL 的一部分。

    这应该可行:

    https://www.googleapis.com/fusiontables/v1/query?sql=insert+into+1d8SL_beOD82al66Xnpb-juHYq8b4WW9m6ORNzsM+(Text)+values+('casa')
    

    然后你必须检查query API documentation,如果哪个操作使用GETPOST,如果是INSERT语句使用POST。就像I was able to insert a row using the OAuth Playground.

    为方便起见,您可能需要查看Google API Explorer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-04
      • 2020-04-11
      • 1970-01-01
      • 2021-03-07
      • 2020-08-11
      • 2018-06-02
      • 2011-12-09
      • 1970-01-01
      相关资源
      最近更新 更多