Do we HAVE to generate and use client libraries to

2019-06-13 17:15发布

问题:

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?

回答1:

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

Authorization: Bearer your_access_token