How to call App Engine Endpoints with the JavaScript library in promises mode

为君一笑 提交于 2019-12-02 04:00:00

Actually the request method DOES work ALL THE TIME with the "path" argument composed of the values of "path" and "name" as declared in the @ApiMethod annotation...

It was a mistake on my side if it didn't work for some endpoints. Don't know which mistake, however.

Note that I have noticed that it is very important to pass to the JavaScript request method the correct httpMethod of the App Engine Endpoints. By default the request methid assumes that it is a GET. In case your Endpoint has httpMethod= ApiMethod.HttpMethod.POST in the @ApiMethod annotation, you shall pass the argument 'method': 'POST', as detailed in the doc: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiclientrequestargs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!