In Web API, can we allow to define more than one POST method?If yes then how and no the why? [Resolved]

Posted by Kumarkrishna184 under WCF on 3/25/2016 | Points: 10 | Views : 549 | Status : [Member] | Replies : 2
In Web API, can we allow to define more than one POST method in a controller?If yes then how and no then why?

Thanks and Regards,
Krishna Kumar



Responses

Posted by: Rajnilari2015 on: 3/25/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
1
Down

Resolved
@Kumarkrishna184 , the answer is yes.. below is an example from the recent project

[HttpPost]
[Route("allocation/banklanding")]
public IHttpActionResult PostBankLandingPage(AllocationCustomerInfo allocationCustomerInfo)
{
List<AllocationAccountDetail> allocationAccountDetailList = new List<AllocationAccountDetail>();
.................................SOME CODE .......................
.................................SOME CODE ..........................

return Ok(allocationAccountDetailList);
}

[HttpPost]
[Route("allocation/feedBackHistory")]
public IHttpActionResult PostFeedBackHistory(string accountno)
{
List<AccountFeedback> feedbackInfoList = new List<AccountFeedback>();
.................................SOME CODE .......................
.................................SOME CODE ..........................

return Ok(feedbackInfoList);
}


Hope that helps

--
Thanks & Regards,
RNA Team

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kumarkrishna184 on: 3/25/2016 [Member] Starter | Points: 25

Up
0
Down
Thanks,
RajniLari Sir,

Thanks and Regards,
Krishna Kumar

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response