I'm trying to programmatically search for an item on the said website.
Following does not work for me. Response is actually an error page, instead of the search result page.
Pls help.
string sUrl = "http://www.arrownac.com/";
string sUrl1 = "http://app.arrownac.com/aws/pg_webc?s=P";
HttpWebRequest owebreq = (HttpWebRequest)WebRequest.Create(sUrl1);
owebreq.Referer = sUrl;
ASCIIEncoding encoding = new ASCIIEncoding();
string postdata = "search_token=" + "743C083102JPTR";
byte[] data = encoding.GetBytes(postdata);
owebreq.ContentType = "text/html";
//"application/x-www-form-urlencoded";
owebreq.Method = "POST";
owebreq.ContentLength = data.Length;
Stream newStream = owebreq.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
HttpWebResponse owebresp = (HttpWebResponse)owebreq.GetResponse();
string sResult = string.Empty;
using (StreamReader sr = new StreamReader(owebresp.GetResponseStream()))
{
sResult = sr.ReadToEnd();
sr.Close();
}