I can fetch a list of blog posts from Google Cloud Endpoints using the Javascript Client:
gapi.client.blog.posts.list().execute(function (resp) {
console.log(resp);
});
But I need to set a custom header value in the Google Cloud Endpoints request that contains a user token (this could be an access token from Facebook). How can I do that using the Javascript Client from Google? I could solve this by not using the Javascript Client from Google, but I would rather use it.
https://developers.google.com/appengine/docs/java/endpoints/consume_js https://developers.google.com/api-client-library/javascript/reference/referencedocs
edit
It seems I can pass the custom header value like this:
gapi.auth.setToken({
access_token: 'this is my custom value'
});
Doesn't seem good practice though. Is there a better way to do this?
setToken
? – Anthony Acciolytoken = os.getenv('HTTP_AUTHORIZATION').split(" ")[1]
– EsseTi