Skip to content

Instantly share code, notes, and snippets.

@FernandoVezzali
Created December 18, 2013 06:11
Show Gist options
  • Save FernandoVezzali/8017981 to your computer and use it in GitHub Desktop.
Save FernandoVezzali/8017981 to your computer and use it in GitHub Desktop.
RequestBinExample
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace RequestBinExample
{
class Program
{
static void Main(string[] args)
{
var task = MakeRequest();
task.Wait();
var response = task.Result;
var body = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(body);
}
private static async Task MakeRequest()
{
var httpClient = new HttpClient();
return await httpClient.GetAsync(new Uri("http://requestb.in/10h36ok1"));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment