How can I pass more than one param in POST endpoint method?

59 views
Skip to first unread message

Renato Forti

unread,
Jan 25, 2016, 5:23:26 AM1/25/16
to Google App Engine
Hi All,

I have this method in my endpoint class:

@ApiMethod(name = "channel.create",  httpMethod = HttpMethod.POST)
public Channel create(User user, App app,  Channel channel, @Named("appId") Long appId) 

The first param id for authentication, the second and third are Entity.

When I generate client lib I get this error:

Error: Method com.rave79.endpoint.ChannelEndpoint.create cannot have multiple resource parameters

Any Idea?

Thanks

Nicholas (Google Cloud Support)

unread,
Jan 26, 2016, 10:55:27 AM1/26/16
to Google App Engine
According to the 'API Parameter and Return Types' article, the following types may be used as parameters:
  • java.lang.String
  • java.lang.Boolean and boolean
  • java.lang.Integer and int
  • java.lang.Long and long
  • java.lang.Float and float
  • java.lang.Double and double
  • java.util.Date
  • com.google.api.server.spi.types.DateAndTime
  • com.google.api.server.spi.types.SimpleDate
  • Any enum
  • Any array or java.util.Collection of a parameter type
The article also contains very useful information about return types and request bodies.
Reply all
Reply to author
Forward
0 new messages