I use a POST method for sending some data to a server and the server replies me back within few seconds. The reply is usually text message "we received your data", however in some cases (depending what I send) it sends back a pictogram - see the attachments. I want to show the pictogram on the screen, then write it with a keyboard into a textbox and send it back again to the server. I suppose I have to read the reply in bytes, not as a text and then decode it to show the pictogram. Can the reading be done with a response object? Is the any example how to read http data in bytes?
If the server replies me with the pictogram I cannot see any received message. The response.ContentLength returns value -1
If the server replies me with the pictogram I cannot see any received message. The response.ContentLength returns value -1
B4X:
request.New1("http://......../main.php")
request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
stream.New1(Request.GetStream,True)
name = "src=" & textbox5.text & "&dst=" & textbox2.Text & "&msg=" & textbox3.Text & _
"&usr=" & textbox7.Text & "&psw=" & textbox8.Text
stream.WriteBytes(stream.StringToBytes(name))
response.New1
response.Value = request.GetResponse
textbox4.text = response.GetString
response.Close