Hamid Reza
Hamid Reza

Reputation: 2975

How to call an ApiController from another .net project?

I have an Asp.net Mvc3 project and I have made a ApiController in it. Now I want to call the api in a windows application project. And I dont know how to config Global.asax or web.config file to approach this. And I dont know what would be the service reference url(If the ApiController name is Service and the method in it is UpdatePrice)?

Upvotes: 0

Views: 5741

Answers (1)

Aneesh Mohan
Aneesh Mohan

Reputation: 1087

You have to make an HTTP request from the application to the WEBAPI action URL you want to access using HttpClient. WEBAPI is a REST based HTTP service, so you can access it only via HTTP unlike WCF on this context.

You can refer here for more information and code samples on this.

Upvotes: 1

Related Questions