Click here to Skip to main content
15,664,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How can I send two parameters in web api HttpPost? Assume that I don't want to change MapRoute.

What I have tried:

// POST: api/Settings/163/20
public bool PostSetting([FromRoute] int facilityId,int bandwidthRequest)
if (!ModelState.IsValid)
return HttpBadRequest(ModelState);
Updated 17-May-16 2:58am
Member 11902764 17-May-16 5:10am    
Try posting object, which holds these 2 values. API and your project should have same class name.

1 solution

Below could be one of the possible solution
    public string PostSetting(int paramOne, int paramTwo)
The {} names need to match your parameters.</pre>
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900