我们是否需要生成并使用客户端库来使用Google App Engine的端点? [英] Do we HAVE to generate and use client libraries to use Google App Engine's Endpoints?

查看:136
本文介绍了我们是否需要生成并使用客户端库来使用Google App Engine的端点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为RESTful API开发具有GAE端点的Swift iOS应用程序。
如果您需要在客户端使用API​​,则所有教程和文档似乎都会生成并使用客户端库。
我想知道是否可以使用简单的URL请求或Alamofire使用API​​并以JSON格式获得结果?

I am currently developing an Swift iOS app with GAE Endpoints for the RESTful API. It seems like all the tutorials and documents make you generate and use client libraries if you need to use the API on the client side. I was wondering if it's possible for me to use the API by just using plain url request or Alamofire and get the result in JSON format?

推荐答案

是的,通过HTTP请求完全可以访问端点。客户端库只是帮助您生成这些请求,而无需知道确切的URL。客户端库最大的帮助是用于身份验证,但是如果您使用Google进行身份验证并以其他方式获取访问令牌,则可以将其添加到请求标头中。

Yes, it's totally possible to access endpoints via HTTP requests. The client libraries just help you to generate those requests without having to know the exact URLs. The biggest part where the client libraries help you is for authentication, but if you authenticate with Google and get an access token another way, you can just add that to the request header as

授权:持票人your_access_token

这篇关于我们是否需要生成并使用客户端库来使用Google App Engine的端点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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