title: Concatenate URL with variable in C#
body: <p>I am trying to concatenate a URL with a variable and then the "rest" of the URL.</p>
  
  <p>It goes like this:</p>
  
  <pre><code>variableName = "1234";
  
  ....
  
  var requestMessage = new HttpRequestMessage(HttpMethod.Get, _configuration["MY_BASE_URL" + variableName + "/theRestOfTheUrl"]);
  </code></pre>
  
  <p>Where the "MY_BASE_URL" is saved as an variable as: <code>"http://mytestsite.com/users/"</code></p>
  
  <p>but when doing this I get the error: </p>
  
  <blockquote>
    <p>"error":"An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.</p>
  </blockquote>
  
  <p><strong>What am I doing wrong?</strong> When just passing:</p>
  
  <pre><code>var requestMessage = new HttpRequestMessage(HttpMethod.Get, _configuration["MY_BASE_URL"]);
  </code></pre>
  
  <p>where I instead have named "MY_BASE_URL" as "<a href="http://mytestsite.com/users/1234/theRestOfTheUrl" rel="nofollow noreferrer">http://mytestsite.com/users/1234/theRestOfTheUrl</a>" I get no errors, but I would to be able to add the variableName too + what comes after, with the option of having the variableName being dynamic - and therefore I can't give it as an entire hardcoded string.</p>