Created
August 8, 2013 08:50
-
-
Save pzurek/6182872 to your computer and use it in GitHub Desktop.
Fails on Mono...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net.Http; | |
namespace VendTest | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
Client client = new Client(); | |
client.HttpClientCall(); | |
} | |
} | |
public class Client | |
{ | |
HttpClient client; | |
public Client() | |
{ | |
client = new HttpClient(); | |
} | |
public async void HttpClientCall() | |
{ | |
HttpClient httpClient = new HttpClient(); | |
HttpResponseMessage response = await httpClient.GetAsync("http://vendhq.com"); | |
string responseAsString = await response.Content.ReadAsStringAsync(); | |
Console.WriteLine(responseAsString); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment