title: How to call API in c# using angularjs
body: <p>Hi I am calling my API using below code</p>
  
  <pre><code>  $http.get('/api/controller/method?param=value').
             then(function (response) {
                 if (response.status == 200) {
                     console.log(response.data);
                 }
             });
  </code></pre>
  
  <p>It is working fine in my local machine (<a href="http://localhost/api/controller/method?param=value">http://localhost/api/controller/method?param=value</a>). </p>
  
  <p>But when I deployed it in server with application name <strong><em>app</em></strong>, it is not able to call the API(<a href="http://server-ip/app/api/controller/method?param=value">http://server-ip/app/api/controller/method?param=value</a>).</p>
  
  <p>Obviously, it won't, as URL are different. <strong>So what is the correct way to call an API in c# so that it will work in any server</strong>.</p>
  
  <p>What I have tried:<br>
  1. <strong>URL.Action</strong> : It is not working in this case.<br>
  2. I don't want to Use <strong>@HTML.hidden</strong> <br>
  3. Call starting with or without  slash (/)</p>