title: MVC 6 Web Api: Resolving the location header on a 201 (Created)
body: <p>In Web Api 2.2, we could return the location header URL by returning from controller as follows:</p>
  
  <pre><code>return Created(new Uri(Url.Link("GetClient", new { id = clientId })), clientReponseModel);
  </code></pre>
  
  <p><code>Url.Link(..)</code> would resolve the resource URL accordingly based on the controller name <code>GetClient</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/RtHSn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/RtHSn.png" alt="Location header"></a></p>
  
  <p>In ASP.NET 5 MVC 6's Web Api, <code>Url</code> doesn't exist within the framework but the <code>CreatedResult</code> constructor does have the location parameter:</p>
  
  <pre><code>return new CreatedResult("http://www.myapi.com/api/clients/" + clientId, journeyModel);
  </code></pre>
  
  <p><strong>How can I resolve this URL this without having to manually supply it, like we did in Web API 2.2?</strong></p>