title: .NET Core API returning response from Web API not including cookies
body: <p>I have a .NET Web API controller that contains the following login method:</p>
  <pre><code>[HttpPost]
  [AllowAnonymous]
  [Route(&quot;api/account/login&quot;)]
  //Web API Controller method
  public virtual async Task&lt;IHttpActionResult&gt; Login(LoginViewModel model)
  {
          SignInStatus response = await this.SignInManager.PasswordSignInAsync(model.Username, model.Password, model.RememberMe, shouldLockout: true);
          if (response == SignInStatus.Success)
              return Ok();
  
          return BadRequest();
  }
  </code></pre>
  <p>The method returns an <code>HttpResponseMessage</code> that contains a number of Headers including <code>Set-Cookie</code>.</p>
  <p>What I need to do is to call this Web API controller from a controller written in .NET Core 3.1 and return the <code>HttpResponseMessage</code> unaltered. This what I currently have:</p>
  <pre><code>    [HttpPost]
      [Route(&quot;[action]&quot;)]
      //.NET Core Controller method
      public async Task&lt;ActionResult&gt; Login(LoginViewModel model)
      {
          HttpClient httpClient = new HttpClient();
          HttpResponseMessage response = await httpClient.PostAsync(WebApiControllerURI, new JsonContent(model));
          return Ok(response);
      }
  </code></pre>
  <p>However, in the response from the .NET Core the <code>Set-Cookie</code> is not a header but is contained in the response body:</p>
  <pre><code>    {
        &quot;Key&quot;: &quot;Set-Cookie&quot;,
        &quot;Value&quot;: [
          &quot;.AspNet.ApplicationCookie=....&quot;
        ]
      },
  </code></pre>
  <p>I get the same result when I try to return the <code>HttpResponseMessage</code> explicitly:</p>
  <pre><code>    [HttpPost]
      [Route(&quot;[action]&quot;)]
      public async Task&lt;HttpResponseMessage&gt; Login(LoginViewModel model)
      {
          HttpClient httpClient = new HttpClient();
          HttpResponseMessage response = await httpClient.PostAsync(serverUrl + LoginUri, new JsonContent(model));
          return response;
      }
  </code></pre>
  <p>How can I return the response from the Web API controller through the .NET Core controller and retain the headers in the <code>Headers</code> property?</p>