uri - c# handle # in url query part -
i have 1 method handle query part of urls,
var uri = new uri(url); var qs = httputility.parsequerystring(uri.query); // stuff
here have special urls below:
var url = "https://a.com/b?p=123&q=c# , java";
there #
in query part , uri.query
gives p=123&q=c
, ignore rest.
how can deal in common way?
since #
can used anchor tag, replace #
%23
seems incorrect.
the url malformed. #
has a specific meaning in url, , nothing after sent server. c# can't that.
wherever url coming from, query string value should url-encoded. this:
https://a.com/b?p=123&q=c%23%20and%20java
this send entire value server, can url-decoded. (which framework you, resulting in string value you're expecting.)
Comments
Post a Comment