I have a class which consists of Post annotation with two methods under it.These methods will be called based on some criteria and they vary by the count(number) of parameters i.e. one method has two and other has three parameter.So when performing this post method from post man how to call the particular method without doing any check conditions i.e. number of parameters and then passing control to the method based on parameter.

  • 1
    Normally you would have to examine the incoming posted data and call the right method depending on that data.
    – Keith C
    Aug 11, 2014 at 11:47

1 Answer 1


You can't "overload" rest methods. Each method must map to exactly one function.

You'll have to either use two functions with different names, or one method that checks the number of parameters and makes the appropriate function call.

  • Thank you for your reply i was curious to know if there is any such way. Aug 13, 2014 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .