c# - How to add query string to httpwebrequest -
i want add querystrings httpwebrequest, cannot find property? remembered there querystring dictionary can use before.
the best way add query string follows:
var targeturi = new uri("http://www.example.org?querystring=a&b=c"); var webrequest = (httpwebrequest)webrequest.create(targeturi); var webrequestresponse = webrequest.getresponse();
remember: if you're using user input construct uri, ensure validate it, escape , don't trust it.
Comments
Post a Comment