title: StatusCode: 405, ReasonPhrase: 'Method Not Allowed'
body: <p>i'm building a Web Application to consume A REST FULL API ASP.Net Core Web Service, i have Problem when i update a records.
  i'm trying to Call Put Method from API ASP.Net core by ASP.Net Core application</p>
  
  <p>I have got an NullReferenceException: Object reference not set to an instance of an object.</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; UpdateEmployee(int id)
  {
      Employee employee = new Employee();
      using(var httpClient=new HttpClient())
      {
          using(var response = await httpClient.GetAsync("myURI/employee/" + id))
          {
               string apiResponse = await 
               response.Content.ReadAsStringAsync();
  
               employee = JsonConvert.DeserializeObject&lt;Employee&gt;apiResponse);
          }
      }
      return View(employee);                   
  }
  
  
  [HttpPost]
  public async Task&lt;IActionResult&gt; UpdateEmployee(Employee employee)
  {
      Employee receivedemployee = new Employee();
      using(var httpClient=new HttpClient())
      {
          var content = new MultipartFormDataContent();
  
         content.Add(new             
          StringContent(employee.EmployeeId.ToString(),Encoding.UTF8, 
              "application/json"), "id");
              content.Add(new 
          StringContent(employee.FirstName,Encoding.UTF8, 
            "application/json"),"FirstName");
              content.Add(new StringContent(employee.LastName, 
           Encoding.UTF8, "application/json"), "LastName");
              content.Add(new StringContent(employee.DateOfBirth.ToString(), 
              Encoding.UTF8, "application/json"), "Email");
              content.Add(new StringContent(employee.PhoneNumber, 
              Encoding.UTF8, "application/json"), "DateOfBirth");
              content.Add(new StringContent(employee.Email, Encoding.UTF8, 
             "application/json"), "Email");
  
              using (var response = await httpClient.PutAsync("myURI/api/employee", content))
              {
  
                  string apiResponse = await response.Content.ReadAsStringAsync();
                  ViewBag.Result = "Success";
                  receivedemployee = JsonConvert.DeserializeObject&lt;Employee&gt;(apiResponse);
              }
              return View(receivedemployee);
          }
       }
  }
  </code></pre>
  
  <p>i expected updating a record</p>