title: Increase max url length in asp.net core
body: <p>I have an asp.net core web api, that enables tts requests. You basically request <code>http://server.url/Whatever you want it to say.mp3</code> to get an mp3 with the text spoken in tts.</p>
  
  <p>But the problem is, that it will return a <code>400 - The request URL is invalid</code> if I pass it a long string. It seems like the server is hitting some sort of max URL length limitation. I can find information on how to fix this is the "classic" asp.net web.config, but not how to fix this in asp.net core.</p>
  
  <p>What is the correct way of increasing the maximum URL length in asp.net core?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>The exact url is for instance:</p>
  
  <p><a href="http://localhost:5000/api/mp3/nl-NL/male/1/Wikipedia%20is%20een%20online%20encyclopedie%20die%20tracht%20inhoud%20te%20bieden%20die%20vrij%20herbruikbaar,%20objectief%20en%20verifieerbaar%20is.%20Het%20project%20is%20gebouwd%20op%20vijf%20zuilen.%20De%20Nederlandstalige%20versie%20startte%20op%2019%20juni%202001%20en%20is,%20gemeten%20naar%20het%20aantal%20artikelen,%20met%20bijna%201,9%20miljoen%20artikelen%20de%20op%20vier%20na%20grootste%20taalversie.mp3" rel="noreferrer">http://localhost:5000/api/mp3/nl-NL/male/1/Wikipedia%20is%20een%20online%20encyclopedie%20die%20tracht%20inhoud%20te%20bieden%20die%20vrij%20herbruikbaar,%20objectief%20en%20verifieerbaar%20is.%20Het%20project%20is%20gebouwd%20op%20vijf%20zuilen.%20De%20Nederlandstalige%20versie%20startte%20op%2019%20juni%202001%20en%20is,%20gemeten%20naar%20het%20aantal%20artikelen,%20met%20bijna%201,9%20miljoen%20artikelen%20de%20op%20vier%20na%20grootste%20taalversie.mp3</a></p>
  
  <p>It is URL-encoded. I'll try to figure out what the exact maximum is.</p>
  
  <p>I cannot use a POST, as the tool that is going to make use of this only supports urls for mp3 files (hence the .mp3 extension used in my controller).</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>The longest request it accepts has 397 characters, which does not seem very logical. If I add one more, it will return a code 400.</p>
  
  <p><strong>Update 3</strong></p>
  
  <p>It turns out to only have this issue when deployed on the server (using IIS), when run locally, it supports way longer strings (I haven't seen it return a code 400 yet). I'll have to look into IIS to see where it goes wrong.</p>