jjzjj

apiClient

全部标签

go - 重用结构以减少堆使用

请解释以下代码中发生的事情。我不明白的部分是服务结构。服务结构是APIClient结构的包装器。当NewAPIClient被调用时,它使用内部的服务结构并复制到自身。我似乎无法解决这个问题。请指教并详细说明。谢谢你。typeAPIClientstruct{cfg*Configuration//Reuseasinglestructinsteadof//allocatingoneforeachserviceontheheap.commonservice//APIServicesAccountApi*AccountApiServiceContractApi*ContractApiServic

php - Google Calendar API 出错 - 添加日历事件时需要 401 登录

因为我正在使用Codeigniter和GoogleapiService/apiCalendarService开发导出和导入到Google日历应用程序。当我从此页面向Google授权我的应用程序时,我已经完美地设置了一切,没问题:包含的代码是重定向发生时发生的事情:session_start();require(APPPATH.'libraries/google/apiClient.php');require(APPPATH.'libraries/google/contrib/apiCalendarService.php');$apiClient=newapiClient();$apiC

ios - 初始化单例异步 iOS

我有一个名为YelpService的单例。它负责从Yelp检索数据。当然,每次API调用都必须经过授权。问题是身份验证过程是异步的。如果我每次在使用YelpService之前都必须检查yelp客户端是否被授权,那将是非常多余的。我该如何解决这个问题?此外,如果我在具有完成处理程序的方法中添加身份验证逻辑,并嵌套在实际进行API调用的其他方法中,我会收到错误消息:Commandfailedduetosignal:Segmentationfault:11存储Yelp客户端以便调用API的安全有效方法是什么?我知道在init中进行网络调用是不好的。classYelpService{stati

ios - Swift : [MyApp. MyClass retain]:发送到释放实例的消息

我的应用程序发生以下崩溃。[MyApp.MyClassretain]老实说,我根本不知道该如何处理这个问题。这只发生在我的swift类(class)中。我需要知道为什么会发生这种情况以及解决此问题的一般方法是什么。这是我的一般swift代码(还有更多内容,但我可能不需要全部发布。classMyClass:NSObject,ApiDelegate,UIAlertViewDelegate{varapiClient:Api?funcinitMyClass(authKey:NSString?){apiClient=Api(authKey:authKey,debugMode:false)apiC

python - Nosetest 和 Google API : "no module named apiclient.discovery"

我正在尝试对使用GoogleTranslateAPI的Python小脚本进行Nose测试。我必须在哪里安装API或者我必须做什么才能让nosetest停止告诉我ImportError:Nomodulenamedapiclient.discovery脚本运行良好,我按照您的方式导入它并使用pip安装它,但我找不到任何关于如何使用nosetest使其工作的信息。任何帮助将不胜感激!:) 最佳答案 Thescriptrunsfine,Iimportitasyouwouldandinstalleditwithpip,butIcan'tfin

python - 调用 apiclient.discovery.build 时 URL 的 SSL 证书无效和/或丢失

所以我使用dev_appserver.py在本地运行我的google端点。我使用APIExplorer来测试应用程序。我用来创建服务,所以我可以调用API的代码如下:fromapiclient.discoveryimportbuildfromoauth2client.clientimportGoogleCredentialscredentials=GoogleCredentials.get_application_default()service=build('speech','v1beta1',credentials=credentials)我收到SSL错误(无效和/或缺少SSL证书

python - 调用 apiclient.discovery.build 时 URL 的 SSL 证书无效和/或丢失

所以我使用dev_appserver.py在本地运行我的google端点。我使用APIExplorer来测试应用程序。我用来创建服务,所以我可以调用API的代码如下:fromapiclient.discoveryimportbuildfromoauth2client.clientimportGoogleCredentialscredentials=GoogleCredentials.get_application_default()service=build('speech','v1beta1',credentials=credentials)我收到SSL错误(无效和/或缺少SSL证书

python安装模块apiclient

python新手,正在尝试安装模块“apiclient”因为我的idepycharm无法识别该导入:fromapiclient.discoveryimportbuild我尝试过的:pip安装apiclient手动下载包https://developers.google.com/api-client-library/python/start/installation#system-requirements然后我将它提取到/Users/nirregev/anaconda/bin/google-api-python-client-1.5.0然后在我的mac终端上运行pythonsetup.p

python - 为什么我使用 Translate API 的 Python App Engine 应用程序收到 ImportError : No module named apiclient. 发现错误?

我在GoogleAppEngine的Python使用了GoogleTranslateAPI时遇到了这个错误,但我不知道如何解决,fromapiclient.discoveryimportbuildImportError:Nomodulenamedapiclient.discovery我会尝试设置向GoogleAppEngineSDK指示的环境,然后再次上传到GoogleAppsEngine,总是报错,Error:ServerErrorTheserverencounteredanerrorandcouldnotcompleteyourrequest.Iftheproblempersist

ruby-on-rails - Google API Ruby 客户端(gem)错误 `uninitialized constant Google::APIClient::UploadIO`

这肯定让我困惑了几个小时。我有bootstrappedmyapplicationasdetailedbyBaugues到通过OAuth2进行身份验证有效的程度,我只是在session#create(回调)操作中进行测试。这是一些代码:classSessionsControllerservice.files.get,#:parameters=>{'id'=>1},#:headers=>{'Content-Type'=>'application/json'})endend身份验证后,上述逻辑在callback方法中执行-出于此粗略测试的目的,它呈现出create.html.erb。我已经注
12