title: HttpClient with BaseAddress
body: <p>I have a problem calling a <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.webhttpbinding%28v=vs.110%29.aspx" rel="noreferrer">webHttpBinding</a> WCF end point using <a href="http://msdn.microsoft.com/en-us/library/system.net.http.httpclient%28v=vs.110%29.aspx" rel="noreferrer">HttpClient</a> and the <a href="http://msdn.microsoft.com/en-us/library/system.net.http.httpclient.baseaddress%28v=vs.110%29.aspx" rel="noreferrer">BaseAddress</a> property.</p>
  
  <p><strong>HttpClient</strong></p>
  
  <p>I created a <a href="http://msdn.microsoft.com/en-us/library/system.net.http.httpclient%28v=vs.110%29.aspx" rel="noreferrer">HttpClient</a> instance specifying the <a href="http://msdn.microsoft.com/en-us/library/system.net.http.httpclient.baseaddress%28v=vs.110%29.aspx" rel="noreferrer">BaseAddress</a> property as a local host endpoint.</p>
  
  <p><img src="https://i.stack.imgur.com/hEBcu.png" alt="enter image description here"></p>
  
  <p><strong>GetAsync Call</strong></p>
  
  <p>I then call the <a href="http://msdn.microsoft.com/en-us/library/hh158912%28v=vs.110%29.aspx" rel="noreferrer">GetAsync</a> method passing in the additional Uri inforamtion.</p>
  
  <pre><code>HttpResponseMessage response = await client.GetAsync(string.Format("/Layouts/{0}", machineInformation.LocalMachineName()));
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/B9XNQ.png" alt="enter image description here"></p>
  
  <p><strong>Service endpoint</strong></p>
  
  <pre><code>[OperationContract]
  [WebGet(UriTemplate = "/Layouts/{machineAssetName}", ResponseFormat = WebMessageFormat.Json)]
  List&lt;LayoutsDto&gt; GetLayouts(string machineAssetName);
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>The problem I am having is that the is that <code>/AndonService.svc</code> part of the BaseAddress is being truncated so the resultant call goes to <code>https://localhost:44302/Layouts/1100-00277</code> rather that <code>https://localhost:44302/AndonService.svc/Layouts/1100-00277</code> resulting in a 404 Not Found.</p>
  
  <p>Is there a reason the BaseAddress is being truncated in the GetAsync call? How do I get around this?</p>