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

前端 未结 1 485
醉梦人生
醉梦人生 2021-01-24 01:57

I have a web application which calls several App Engine Endpoints with the Google API JavaScript client library.

I am currently changing this application from callback

相关标签:
1条回答
  • 2021-01-24 02:57

    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

    0 讨论(0)
提交回复
热议问题