Esse codigo meu pega todo um conteudo especifico de um site Como simular o click de um botão?
[Route("HomeController/Requisicao")] // Matches 'Products/Index'
public string Requisicao()
{
var result = "";
string path = "http://testedev-rpa.ddns.net";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(path);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
streamWriter.Write(true);
streamWriter.Flush();
streamWriter.Close();
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
result = streamReader.ReadToEnd();
}
}
return result;
}