YouTube API v3示例项目引发GTLJSONRPCErrorDomain -32602错误的请求错误 [英] YouTube API v3 sample project raising GTLJSONRPCErrorDomain -32602 bad request error

查看:608
本文介绍了YouTube API v3示例项目引发GTLJSONRPCErrorDomain -32602错误的请求错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了 Google API客户端C客户端

一>。我在Mac上的Xcode中打开了YouTube示例项目。它构建并运行时没有错误。



我使用 Google API ,并为已安装的应用程序创建了一个客户端ID,选择iOS并输入示例代码的Bundle ID com.example.YouTubeSample。我将App Store ID留空并禁用深层链接。



我将生成的客户端ID和客户端密码输入示例应用程序。我也通过应用程序的窗口在Google上签了名自我,并告诉我我已登录。



独立地,我去YouTube上传了一个1Mb .mov文件,没问题(虽然它告诉我可能有音频/视频同步问题)。然后,我通过示例应用上传了相同的文件。当它完成时,它给了我错误:

 错误域= com.google.GTLJSONRPCErrorDomain代码= -32602 
(错误的请求)
UserInfo = 0x .... {error =错误的请求,NSLocalizedFailureReason =(错误的请求),
GTLStructuredError = GTLErrorObject 0x ...:
{message:Bad Requestdata:[1] code:-32602}}

(由于示例应用程序适用于Mac OS,而不是iOS,因此我还尝试在Google API中为已安装的其他应用程序创建第二个客户端ID,然后将该新ID和秘密输入到示例应用程序中,我上传了.mov文件,我得到了同样的错误。)



在API控制台中,我看到一个显示一些新的错误代码400的错误报告。



我做错了什么?

谢谢!

解决方案

我刚刚退出并重新启动了Xcode和示例项目,它工作正常(使用iOS客户端ID,我没有尝试了另一个)。



快乐的日子!

I have just downloaded the Google API objective C client. I opened the YouTube example project in Xcode on my Mac. It builds and runs without errors.

I registered a project with Google APIs, and created a Client ID for installed applications, choosing iOS and entering the sample code's Bundle ID, com.example.YouTubeSample. I left the App Store ID blank and deep linking disabled.

I entered the resulting Client ID and Client secrets into the sample app. I signed myself into Google through the app's window too, and it tells me I am signed in.

Independently I went to YouTube and uploaded a 1Mb .mov file, which uploads fine (although it tells me there may be an audio/video sync issue).

I then uploaded the same file through the sample app. When it finished, it gave me the error:

Error Domain=com.google.GTLJSONRPCErrorDomain Code=-32602 
   "The operation couldn’t be completed. (Bad Request)" 
   UserInfo=0x.... {error=Bad Request, NSLocalizedFailureReason=(Bad Request), 
   GTLStructuredError=GTLErrorObject 0x...: 
   {message:"Bad Request" data:[1] code:-32602}}

(Since the sample app is for Mac OS, not iOS, I also tried creating a second Client ID in Google APIs, for an installed application of type "other". I entered this new ID and secret into the sample app, and when I uploaded the .mov file I got the same error.)

Over in the API console, I see an error report showing some new Error code 400s.

What have I done wrong?

thanks!

解决方案

I just quit and restarted Xcode and the sample project, and it worked (using the iOS client ID, I haven't tried the other one).

Happy days!

这篇关于YouTube API v3示例项目引发GTLJSONRPCErrorDomain -32602错误的请求错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆