sangy14 / google-plugin-for-eclipse

Automatically exported from code.google.com/p/google-plugin-for-eclipse
0 stars 0 forks source link

Endpoint Annotation/@ApiMethod : the default of httpMethod attrubute is chosen based on the name of the method. #262

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Make a endpoint method: 
  public BookResponse listBook(BookRequest req, User user){...}
2.Then assign @ApiMethod(name="listBook"), omit the httpMethod attibute.
3.This endpoint method endpoint description in "bookManager-vi.api" will auto 
be ... "httpMethod" : "GET"...

if we use api explorer "http://apis-explorer.appspot.com/apis-explorer"...
 to call this endpoint method, it will do a http "GET" method action to retrieval the result, 
 the request body ("BookRequest") won't be passed into endpoint method.

But, the strange is, it works fine when we using javascript gai to call it.

In Endpoint Annotation document : 
https://developers.google.com/appengine/docs/java/endpoints/annotations#attribut
es_1
It defined httpMethod: The HTTP method to use. If you don't set this, a default 
is chosen based on the name of the method.

We would expect that it is chosen based on whether the endpoint method contains 
custom Object parameter, 
because it has to use the POST method.

We use [eclipse/plugin/4.3], [AppEngine 1.8.9] and with client [javascript gapi 
client]

Thanks.

Original issue reported on code.google.com by vegaquem...@gmail.com on 30 Jan 2014 at 7:22