5

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 '14 at 11:47
3

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. – Manoj Chandran Aug 13 '14 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.