Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
i have this simple class in an asp.net MVC web api:

SQL
public class OrdersController : ApiController
    {
        // GET api/orders
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // POST api/orders
        [HttpPost]
        public void Post([FromBody]string value)
        {
        }

        
    }


going to this url: http://localhost:55186/api/orders[^]

returns:
<ArrayOfstring>
    <string>value1</string>
    <string>value2</string>
</ArrayOfstring>


how can i call the post method in C# console application?

Thanks,
Gabriel Sas
Posted
Updated 31-Aug-13 4:21am
v2

1 solution

 
Share this answer
 
Comments
Joezer BH 1-Sep-13 8:04am    
5ed!
ridoy 1-Sep-13 8:17am    
Thank you,:)

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