title: Get absolute URL inside Web API Controller?
body: <p>In my Controller I can't use <code>CreatedAtAction</code> for reasons out of the scope of this question.
  I therefore need to do the following, however I don't know how to get the absolute URL of the Web API to  correctly set the <code>Location</code> header?</p>
  <pre><code>public async Task&lt;ActionResult&lt;string&gt;&gt; PostItem(ItemPostRequest itemPostRequest)
  {
      // call repository etc.
  
      string baseUrl= // &lt;------- how to get this?
      Response.Headers.Add(&quot;Location&quot;, baseUrl + insertId);
  
      return Content(savedItem, &quot;application/json&quot;, System.Text.Encoding.UTF8);
  }
  </code></pre>
  <p>I am on .NET 5.0, in case this matters.</p>