This is the code I'm using, (taken largely from another online source, btw):
string uri = "http://www.blah.com";
// Create my request
HttpWebRequest hwrOrdersIDCallback = (HttpWebRequest)WebRequest.Create(uri);
hwrOrdersIDCallback.KeepAlive = false;
hwrOrdersIDCallback.ProtocolVersion = HttpVersion.Version10;
hwrOrdersIDCallback.Method = "POST";
// Turn the req string into a byte stream
byte[] postBytes = Encoding.ASCII.GetBytes(sbOrderIDsLine.ToString());
// Set content type and stream length
hwrOrdersIDCallback.ContentType = "application/x-www-form-urlencoded";
hwrOrdersIDCallback.ContentLength = postBytes.Length;
Stream requestStream = hwrOrdersIDCallback.GetRequestStream();
// Send the POST
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
// Grab the response and display it in a label
HttpWebResponse hwrOrdersIDResponse = (HttpWebResponse)hwrOrdersIDCallback.GetResponse();
label1.Text = (new StreamReader(hwrOrdersIDResponse.GetResponseStream()).ReadToEnd());
I should be getting some specific data back from the server if the POST was completed successfully. I am NOT getting that data and I wanted to know if there was a way to see the information that is getting sent to the server by this POST.