I need a very simple HttpWebRequest Post example in ASP.NET c#..

I have many examples that do screen scrapes and return content as XML and such, BUT I don't need to get any kind of response.  I want the code to be very simple and in as few files of code as possible.

All I have to do is a pass three parameters to a web service via HTTP.

Who can give me an example?  Thanks!
sggexchangeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kaylanreilorCommented:
0
sggexchangeAuthor Commented:
These examples do work, but they are pretty much the same thing I've seen before.  I do not need ANY response from the webserver at all, so do I have to use a WebResponse object at all?  I guess I'm just trying to do it with less code.
0
kaylanreilorCommented:
But when the guy writes something like this, it should match what's you're looking for :
byte[]  buffer = Encoding.ASCII.GetBytes(strBuffer);
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(strPage);
WebReq.Method = "POST";
WebReq.ContentType ="application/x-www-form-urlencoded";
WebReq.ContentLength = buffer.Length;
Stream PostData = WebReq.GetRequestStream();
PostData.Write(buffer, 0, buffer.Length);
PostData.Close();

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sggexchangeAuthor Commented:
that works...missed that bit the first time.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.