Streaming byte array (wodHttpDLX)
Jasmine,
Thanks for your assistance.
Here is my code:
string mytran = "Login Credentials and CC Data";
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
// Create a request using a URL that can receive a post.
WebRequest request = WebRequest.Create("webaddress");
// Set the Method property of the request to POST.
request.Method = "POST";
// Create POST data and convert it to a byte array.
byte[] byteArray = Encoding.UTF8.GetBytes(mytran);
// Set the ContentType property of the WebRequest.
request.ContentType = "application/x-www-form-urlencoded";
// Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length;
Stream dataStream;
try
{
// Get the request stream.
dataStream = request.GetRequestStream();
// Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close();
}
catch (Exception f)
{
MessageBox.Show(f.ToString());
}
// Get the response.
WebResponse response = request.GetResponse();
// Get the stream containing content returned by the server.
dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
Complete thread:
- Streaming byte array - AtlantaGator, 2017-08-24, 18:13
- Streaming byte array - Jasmine, 2017-08-24, 19:28
- Streaming byte array - AtlantaGator, 2017-08-24, 21:16
- Streaming byte array - Jasmine, 2017-08-24, 21:23
- Streaming byte array - AtlantaGator, 2017-08-24, 21:55
- Streaming byte array - Jasmine, 2017-08-24, 21:59
- Streaming byte array - AtlantaGator, 2017-08-24, 23:23
- Streaming byte array - Jasmine, 2017-08-24, 23:25
- Streaming byte array - AtlantaGator, 2017-08-24, 23:40
- Streaming byte array - AtlantaGator, 2017-08-25, 16:47
- Streaming byte array - Jasmine, 2017-08-25, 19:25
- Streaming byte array - AtlantaGator, 2017-08-25, 16:47
- Streaming byte array - AtlantaGator, 2017-08-24, 23:40
- Streaming byte array - Jasmine, 2017-08-24, 23:25
- Streaming byte array - AtlantaGator, 2017-08-24, 23:23
- Streaming byte array - Jasmine, 2017-08-24, 21:59
- Streaming byte array - AtlantaGator, 2017-08-24, 21:55
- Streaming byte array - Jasmine, 2017-08-24, 21:23
- Streaming byte array - AtlantaGator, 2017-08-24, 21:16
- Streaming byte array - Jasmine, 2017-08-24, 19:28