title: Http post works in Postman but not in C# with HttpClient
body: <p>If I made a Http (Https) post through Postman everything works fine. But if I tried the same post with the HttpClient in .NET core it won't work it seems like the Authorization failed or something like that because the <code>response.StatusCode</code> is OK but if I read the content string I get a HTML page with 404 and its asking me if I like to login.</p>
  
  <p>Of course I already checked the obvious things like the address and I tried different tokens (they always worked in postman). I also tried different versions of adding the Bearer token:</p>
  
  <pre><code>client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
  </code></pre>
  
  <p>This is the code at the moment:</p>
  
  <pre><code>client.BaseAddress = new Uri("www.baseaddress.de");
  client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
  var content = new StringContent(JsonConvert.SerializeObject(new { id = object.Id }), Encoding.UTF8, "application/json");
  HttpResponseMessage response = await client.PostAsync($"/address", content);
  </code></pre>
  
  <p>Postman Headers:
  <a href="https://i.stack.imgur.com/rgKyZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rgKyZ.png" alt="Postman headers"></a></p>
  
  <p>The body:</p>
  
  <p><a href="https://i.stack.imgur.com/xu3pH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xu3pH.png" alt="Postman body"></a></p>
  
  <p>I also tried it with insomnia and it works perfectly there too. Maybe postman do something in its header which I don't know? What are the common differences between postman an HttpClient? Does anyone have any other suggestion about what I could do or try to find the mistake?</p>
  
  <p>Edit:</p>
  
  <p>Fixed it by adding the <code>/</code> behind the base address and deleting it in front of the call:</p>
  
  <pre><code>client.BaseAddress = new Uri("www.baseaddress.de/");
  HttpResponseMessage response = await client.PostAsync($"address", content);
  </code></pre>
  
  <p>Maybe anyone knows why the <code>/</code> is needed at the end of the base address, why can't I put it before the API call?</p>