端点适用于localhost但不适用于应用引擎(省略https://)

时间:2016-10-12 22:24:15

标签: google-app-engine oauth-2.0 google-cloud-endpoints google-plugin-eclipse

我想在不使用OAuth的情况下访问我的端点功能。

我按照Simple access to API上的指南进行了调整并略微调整了代码。

我可以访问localhost上的API - 我必须等待大约五分钟才能加载它们。然后它们出现在资源管理器 / _ ah / api / explorer

但是我无法访问app引擎上的端点函数:

函数加载但我无法访问它们:

var rootpath = "//" + window.location.host + "/_ah/api";
gapi.client.load('helloworldendpoints', 'v1', makeRequest, rootpath); 
// callback gets executed 

...
var request = gapi.client.helloworldendpoints.sayHello();
//any code below this does not get executed

1 个答案:

答案 0 :(得分:0)

到目前为止,这对我来说是编码中最令人难以忍受的错误!:D

而不是

https://helloworld-146410.appspot.com/

https://1-dot-helloworld-146410.appspot.com/

我没有包含https://并使用

helloworld-146410.appspot.com

1-dot-helloworld-146410.appspot.com

没有https:我无法访问端点

我可以回到30多个小时的生活中吗?:D我怎么能避免这个错误或更快地解决这个问题?

相关问题