title: Parse and modify a query string in .NET Core
body: <p>I am given an absolute URI that contains a query string. I'm looking to safely append a value to the query string, and change an existing parameter.</p>
  
  <p>I would prefer not to tack on <code>&amp;foo=bar</code>, or use regular expressions, URI escaping is tricky. Rather I want to use a built-in mechanism that I know will do this correctly and handle the escaping.</p>
  
  <p>I've <a href="https://stackoverflow.com/a/17096289/492405">found</a> <a href="https://stackoverflow.com/q/10232034/492405">a</a> <a href="https://stackoverflow.com/questions/11956948/easiest-way-to-parse-querystring-formatted-data">ton</a> of answers that all use <code>HttpUtility</code>. However this being ASP.NET Core, there is no more System.Web assembly anymore, thus no more <code>HttpUtility</code>.</p>
  
  <p>What is the appropriate way to do this in ASP.NET Core while targeting the core runtime?</p>