Portable Class Library (PCL) Version Of HttpUtility.ParseQueryString

后端 未结 4 1256
天命终不由人
天命终不由人 2021-02-12 23:18

Is there a Portable Class Library (PCL) version Of HttpUtility.ParseQueryString contained in System.Web or some code I could use? I want to read a very complex URL.

4条回答
  •  梦毁少年i
    2021-02-12 23:37

    My Flurl library is a PCL that parses query strings into IDictionary when you instantiate a Url object from a string:

    using Flurl;
    
    var url = new Url("http://...");
    // get values from url.QueryParams dictionary
    

    The relevant parsing logic is here. Flurl is small, but feel free to swipe just those bits if you want.

提交回复
热议问题