This is what I have so far. Fairly new myself. Would much appreciate the help. I am aiming to save the info into a text file created pretty much anywhere, but preferably inside temp folder or something.
static async void GetNewData()
{
String page = "http://www.coinmarketcap.com";
var client = new HttpClient();
// Create the HttpContent for the form to be posted.
var requestContent = new FormUrlEncodedContent(new[] {
new KeyValuePair<string, string>("text", "This is a block of text"),
});
// Get the response.
HttpResponseMessage response = await client.PostAsync(page,
requestContent);
// Get the response content.
HttpContent responseContent = response.Content;
// Get the stream of the content.
using (var reader = new StreamReader(await responseContent.ReadAsStreamAsync()))
{
// Write the output.
Console.WriteLine(await reader.ReadToEndAsync());
using (StreamWriter w = File.AppendText(reader.ReadToEndAsync().ToString);
// StreamWriter sw1 = new StreamWriter(File.OpenWrite());
// sw1.Write(await reader.ReadToEndAsync() textytext);
}
}
}
}
Once again, any advice would be extremely helpful, and I will be sure to upvote the most accurate answer :)