title: How to call Web API (App Service) remotely
body: <p>I need to call an API from AppService by uri.</p>
  
  <p>This is my API:</p>
  
  <pre><code>public ApiOutputBase Test_AddStudent(string name, int age, string address)
  {
       return new ApiOutputBase
       {
            Result = new Result { Status = true, Message = "OK,Test_AddStudent Done!" },
            OuputValues = new List&lt;object&gt;() { name, age, address }
       };
  }
  </code></pre>
  
  <p>I use this Function to call it:</p>
  
  <pre><code>public async Task&lt;bool&gt; TestCallApi()
  {
       var client = new HttpClient { BaseAddress = new Uri("http://localhost/") };
       client.DefaultRequestHeaders.Accept.Clear();
       client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
  
       var testJson = "{\r\n    \"name\": \"MyName\",\r\n    \"age\": 25,\r\n    \"address\": \"MyAddress\"\r\n}";
       HttpResponseMessage response = await client.PostAsync("api/services/myApp/commonLookup/Test_AddStudent", new StringContent(testJson));
  
       // Call api success
       if (response.IsSuccessStatusCode)
       {
       }
  
       return true;
  }
  </code></pre>
  
  <p>I used Swagger to call <code>Test_AddStudent</code> successfully. The <code>testJson</code> was copied from Swagger when I call <code>Test_AddStudent</code> successfully.</p>
  
  <p>After that, I used Swagger to call <code>TestCallApi</code> without any error, but when I tried to debug the value of <code>HttpResponseMessage</code>, it showed this error:</p>
  
  <pre><code>{
      StatusCode: 400,
      ReasonPhrase: 'Bad Request',
      Version: 1.1,
      Content: System.Net.Http.StreamContent,
      Headers: {
          Pragma: no-cache
          Cache-Control: no-store, no-cache
          Date: Tue, 31 Oct 2017 02:12:45 GMT
          Set-Cookie: Abp.Localization.CultureName=en; expires=Thu, 31-Oct-2019 02:12:45 GMT; path=/
          Server: Microsoft-IIS/10.0
          X-AspNet-Version: 4.0.30319
          X-Powered-By: ASP.NET
          Content-Length: 405
          Content-Type: application/json; charset=utf-8
          Expires: -1
      }
  }
  </code></pre>
  
  <p>Have I missed something?</p>