Are you saying you're having a problem doing the POST? The following
function posts to a website and returns a response stream. The body of the
post is passed as a string (sPOST). If you need help figuring out what
should be in the post body, spend some time watching what IE passes up using
a tool like
www.fiddlertool.com provides.
public static Stream DoHTTPPost(string sURL, string sLang, string sPOST)
{
HttpWebRequest oRequest = (HttpWebRequest)WebRequest.Create(sURL);
oRequest.UserAgent= "Picker/1.0";
oRequest.Headers.Add("Accept-Language", sLang);
oRequest.Method = "POST";
oRequest.ContentType="text/xml";
StreamWriter myWriter = null;
Stream strmPost = oRequest.GetRequestStream();
try
{
myWriter = new StreamWriter(strmPost, System.Text.Encoding.UTF8);
myWriter.Write(sPOST);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
finally
{
myWriter.Close();
}
return oRequest.GetResponse().GetResponseStream();
}
--
Thanks,
Eric Lawrence
Program Manager
Assistance and Worldwide Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"_eee_" <_n****@nomail.com> wrote in message
news:7b********************************@4ax.com...
I recently posted a query about screen scraping, but haven't turned up
any leads yet. Here's what I need to do:
The first screen is retrieved via HttpWebRequest/Response. Easy
enough, as no parameters are required. But then I need to fill in
some fields from that initial screen and POST it back to the website
(to get back info on a specific subject).
It seems easier to do a GET, but unfortunately I need to do this via
POST.
Surely this has been done a lot, right? Any clues on where to look?
Are there other newsgroups that would be more appropriate for this
question?