I want to add some querystrings to httpwebrequest, however I cannot find any property? I remembered there is a QueryString dictionary which I can use before.
The best way to add a query string is as 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 to construct the Uri, ensure that you validate it, escape it and don't trust it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With