title: Not able to use string over 260 characters as a segment of URL in .NET Core
body: <p>I'm making a request that works great and acts as supposed to. The actual authorization is provided using headers and working as expected too. This is the URL of it.</p>
  
  <blockquote>
    <p><a href="https://localhost:44385/api/security/check" rel="nofollow noreferrer">https://localhost:44385/api/security/check</a></p>
  </blockquote>
  
  <p>By coincidence, I happened to replace the verbatim string <em>check</em> with the actual token, so the URL changed to </p>
  
  <blockquote>
    <p><a href="https://localhost:44385/api/security/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ" rel="nofollow noreferrer">https://localhost:44385/api/security/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ</a>...</p>
  </blockquote>
  
  <p>All in all, the token happens to be 475 characters long. Then, when executing that call, I get the error message as follows.</p>
  
  <blockquote>
    <p>Error: connect ECONNREFUSED 127.0.0.1:44300</p>
  </blockquote>
  
  <p>I don't understand the issue and the status code 400 tells me only that the request is bad. Is it purely due ot the length of the URL? It seems like a bit too short (although there is a limitation for that but we're talking about a few thousands characters)...</p>
  
  <p>The signature of the receiving method in the controller looks like this. It resides in the controller with path <em>Security</em>.</p>
  
  <pre><code>[HttpHead("{check}"), Authorize]
  public IActionResult IsAuthorized(string check) { ... }
  </code></pre>
  
  <p>I also tried GET instead of HEAD with the same result. It's difficult to learn more about the error based on <em>400 Bad request</em> only. It's a bit like <em>something went wrong somewhere</em> kind of error.</p>
  
  <p>After some experimenting, I can confirm that it's <strong>not</strong> the length of the URL as such but rather the length of the segment between slashes. The first request works, the other does too but the third doesn't. The <em>xxx</em> part is precisely 260 characters and **yyy* part is precisely 261.</p>
  
  <blockquote>
    <p><a href="https://localhost:44385/api/test/xxx" rel="nofollow noreferrer">https://localhost:44385/api/test/xxx</a><br>
    <a href="https://localhost:44385/api/testtest/xxx" rel="nofollow noreferrer">https://localhost:44385/api/testtest/xxx</a><br>
    <a href="https://localhost:44385/api/test/yyy" rel="nofollow noreferrer">https://localhost:44385/api/test/yyy</a></p>
  </blockquote>
  
  <p>What is this about?! It's like <code>string</code> in a method in my WebAPI can't be longer than 260 characters. Not 256, which at least would make some kind of sense...</p>
  
  <p>Googling gave a <strong>veeery</strong> wide range of vastly spread hits and gave me nothing that I could relate to. Postman provides pretty much the same, limited information. The browser's network tab give even less.</p>
  
  <p>A bit confused how to get to know more, how to diagnose it further and/or what to google for. Since it's a non-problem for the production environment, I can't bother my colleagues - the question is purely academic.</p>