Skip to main content
 首页 » 编程设计

python之谷歌云端点发现文档附加 https ://to the base and root url

2024年11月01日7mfryf

已经发现使用 endpointscfg.py 生成的发现文档将 https://附加到端点 api 中提供的主机名。例如:

endpoints.api(name='test', 
    version='v1', 
    description='description', 
    audiences=AUDIENCES, 
    allowed_client_ids=CLIENT_IDS, 
    hostname='abc.com')(TestService) 

生成的发现文档中有问题的部分如下:

"protocol": "rest", 
"baseUrl": "https://abc.com/_ah/api/test/v1/", 
"basePath": "/_ah/api/test/v1/", 
"rootUrl": "https://abc.com/_ah/api/", 

我只需要将 http 而不是 https 附加到上述 url。有办法实现吗?

请帮忙。 提前致谢。

请您参考如下方法:

不支持自定义域。如果使用hostname='myapp.appspot.com',则必须使用https,因为

下的路径
https://myapp.appspot.com/_ah/api/.* 

由 Google 的 API 基础架构而非您的应用程序控制。对于这些 URI,仅允许 https。