Search code examples
c#httpwebrequestget

How to make an HTTP get request with parameters


Is it possible to pass parameters with an HTTP get request? If so, how should I then do it? I have found an HTTP post requst (link). In that example the string postData is sent to a webserver. I would like to do the same using get instead. Google found this example on HTTP get here. However no parameters are sent to the web server.


Solution

  • In a GET request, you pass parameters as part of the query string.

    string url = "http://somesite.com?var=12345";