Hello,
I have a vb.net application where i am sending error string to a php page to process it.
Dim errorString as String = "test string"
Dim request As WebRequest = WebRequest.Crea te("index.php" )
request.Method = "POST"
Dim byteArray As Byte() = Encoding.UTF8.G etBytes(errorSt ring)
request.Content Type = "applicatio n/x-www-form-urlencoded"
request.Content Length = byteArray.Lengt h
Dim dataStream As Stream = request.GetRequ estStream()
dataStream.Writ e(byteArray, 0, byteArray.Lengt h)
dataStream.Clos e()
Dim response As WebResponse = request.GetResp onse()
dataStream = response.GetRes ponseStream()
Dim reader As New StreamReader(da taStream)
Dim responseFromSer ver As String = reader.ReadToEn d()
reader.Close()
dataStream.Clos e()
response.Close( )
Debug.Print(res ponseFromServer )
The responseFromSer ver is empty. Doesn't show the errorString.
My php page for testing looks like this:
$a = $_POST['errorString'];
echo $a;
Does anyone know what I am missing? Any help would be greatly appreciated.
Thanks in advance!
J!
I have a vb.net application where i am sending error string to a php page to process it.
Dim errorString as String = "test string"
Dim request As WebRequest = WebRequest.Crea te("index.php" )
request.Method = "POST"
Dim byteArray As Byte() = Encoding.UTF8.G etBytes(errorSt ring)
request.Content Type = "applicatio n/x-www-form-urlencoded"
request.Content Length = byteArray.Lengt h
Dim dataStream As Stream = request.GetRequ estStream()
dataStream.Writ e(byteArray, 0, byteArray.Lengt h)
dataStream.Clos e()
Dim response As WebResponse = request.GetResp onse()
dataStream = response.GetRes ponseStream()
Dim reader As New StreamReader(da taStream)
Dim responseFromSer ver As String = reader.ReadToEn d()
reader.Close()
dataStream.Clos e()
response.Close( )
Debug.Print(res ponseFromServer )
The responseFromSer ver is empty. Doesn't show the errorString.
My php page for testing looks like this:
$a = $_POST['errorString'];
echo $a;
Does anyone know what I am missing? Any help would be greatly appreciated.
Thanks in advance!
J!
Comment