I am having some trouble posting to website..I've tried posting to many different websites and get the same result.. An error message referencing the js on the page, asking if i want to continue.. Then the response i get is the form I am posting to, with all fields correctly filled in. It looks like data was posted and never submitted?? I can't figure out where it's going wrong, and any help would be greatly appreciated. Here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Diagnostics;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
WebRequest req = WebRequest.Create("https://propaccess.trueautomation.com/clientdb/?cid=68");
string postData = "propertySearchOptions:searchType=Owner Name&propertySearchOptions:taxyear=2013&propertySearchOptions_ownerName=" + "xto";
byte[] send = Encoding.Default.GetBytes(postData);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = send.Length;
Stream sout = req.GetRequestStream();
sout.Write(send, 0, send.Length);
sout.Flush();
sout.Close();
WebResponse res = req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
string returnvalue = sr.ReadToEnd();
webBrowser1.DocumentText = returnvalue;
}
}
}