Skip to content

Instantly share code, notes, and snippets.

@paulohenriquesn
Created June 20, 2018 15:05
Show Gist options
  • Save paulohenriquesn/203e0edb9c1e57234abcdc22d4304410 to your computer and use it in GitHub Desktop.
Save paulohenriquesn/203e0edb9c1e57234abcdc22d4304410 to your computer and use it in GitHub Desktop.
public static async void GetResponse(string server,string @params)
{
httpWebRequest = (HttpWebRequest)WebRequest.Create($"http://{server}/{@params}");
HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
string method = httpWebResponse.Method;
if (String.Compare(method, "GET") == 0)
{
Stream receiveStream = httpWebResponse.GetResponseStream();
StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
// MessageBox.Show(readStream.ReadToEnd());
response = readStream.ReadToEnd();
httpWebResponse.Close();
}
}
@paulohenriquesn
Copy link
Author

paulohenriquesn commented Jun 20, 2018

example:

GetResponse("localhost","?getgameName&getgameVersion&getgameRegion");
even
http://localhost:80?getgameName&getgameVersion&getgameRegion/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment