Parse and modify a query string in .NET Core

后端 未结 6 647
無奈伤痛
無奈伤痛 2020-11-29 00:38

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.

I would prefer

6条回答
  •  广开言路
    2020-11-29 01:32

    It's important to note that in the time since the top answer has been flagged as correct that Microsoft.AspNetCore.WebUtilities has had a major version update (from 1.x.x to 2.x.x).

    That said, if you're building against netcoreapp1.1 you will need to run the following, which installs the latest supported version 1.1.2:

    Install-Package Microsoft.AspNetCore.WebUtilities -Version 1.1.2

提交回复
热议问题