using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
public static async Task<string> GetData()
Console.WriteLine("Hello World");
var nvc = new List<KeyValuePair<string, string>>();
nvc.Add(new KeyValuePair<string, string>("api_key", "tzVTKjC8iDzz"));
var client = new HttpClient();
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
var req = new HttpRequestMessage(HttpMethod.Post, "https://www.parsehub.com/api/v2/projects/tbomQ5iTYMMv/run")
{Content = new FormUrlEncodedContent(nvc)};
var res = await client.SendAsync(req);
Console.WriteLine("Test");
Console.WriteLine(ex.Message);
public static void WebRequestTest(){
WebRequest request = WebRequest.Create ("https://www.parsehub.com/api/v2/projects/tbomQ5iTYMMv/run");
string postData = "api_key=tzVTKjC8iDzz";
byte[] byteArray = Encoding.UTF8.GetBytes (postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream ();
dataStream.Write (byteArray, 0, byteArray.Length);
WebResponse response = request.GetResponse ();
Console.WriteLine (((HttpWebResponse)response).StatusDescription);
dataStream = response.GetResponseStream ();
StreamReader reader = new StreamReader (dataStream);
string responseFromServer = reader.ReadToEnd ();
Console.WriteLine (responseFromServer);