简体   繁体   English

Google云端硬盘API不接受和编码以及未编码

[英]Google drive API doesn't accept & encoded and unencoded

I built an application in PHP which uses gdrive sdk to do the following query for a tile containing certain keywords. 我在PHP中构建了一个应用程序,该应用程序使用gdrive sdk对包含某些关键字的图块执行以下查询。 As of 9-17-2014, accord to error logs, the api does not return files if the title im querying for has an "&" ( or encoded %26) . 从2014年9月17日开始,根据错误日志,如果要查询的标题具有“&”(或编码为%26),则api不返回文件。
I tested this using https://developers.google.com/oauthplayground/ 我使用https://developers.google.com/oauthplayground/进行了测试

I authenticated and ran the following call: 我认证并运行了以下调用:

https://www.googleapis.com/drive/v2/files?maxResults=2&q=title+contains+%27Referral+%27 https://www.googleapis.com/drive/v2/files?maxResults=2&q=title+contains+%27Referral+%27

Returned 2 files as expected. 如预期返回2个文件。 The full file name is "Referral & UUs". 完整的文件名为“ Referral&UUs”。

if i try the original query, which worked prior to 9-17-2014 如果我尝试原始查询,该查询在2014年9月17日之前有效

https://www.googleapis.com/drive/v2/files?maxResults=2&q=title+contains+%27Referral+%26%27 https://www.googleapis.com/drive/v2/files?maxResults=2&q=title+contains+%27Referral+%26%27

Returns nothing.... 什么都不返回。

Does the Google Drive not accept ampersands anymore ? Google云端硬盘是否不再接受&符?

This appears to be a bug in the Files.list() endpoint, and I've raised the issue internally. 这似乎是Files.list()端点中的错误,我在内部提出了此问题。 At least for now, you can work around the problem by requesting the scope " https://www.googleapis.com/auth/drive.appdata " in addition to the other scopes you are requesting. 至少目前,您可以通过请求范围“ https://www.googleapis.com/auth/drive.appdata ”和其他要求的范围来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM