简体   繁体   中英

Does the Windows Runtime Windows.Web.Http namespace provide a way to extract query parameters from a URI?

I've found that it can be done with the HttpUtility.ParseQueryString method class, but namespace System.Web that contains it is not available for WinRT, according to the documentation it's recommend to use the classes from Windows.Web.Http to perform HTTP tasks on Windows Runtime projects, there is anything within this namespace that allows to extract query parameters from a URI as a collection? I tried to look for something within it, but I couldn't find anything that could be used for that.

Thanks in advance.

Edit:

Note that System.Web namespace is not available on WinRT.

    Uri baseUri = new Uri ("http://www.contoso.com/");
    Uri myUri = new Uri (baseUri, "catalog/shownew.htm?date=today");

    Console.WriteLine (myUri.Query);

returns ?date=today

http://ideone.com/HosL2P

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM