I'm very new whith http & PHP coding. I just want to understand why this simple example (get method) receives a sort of ASCIIZ response (0/nul ending added).Thanks
B4X:
<?php
$hst = $_GET['hst'];
echo($hst);
?>
B4X:
Sub Process_Globals
Dim httpC As HttpClient
End Sub
Sub Globals
Dim hst As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
httpC.Initialize("httpC")
End If
check
End Sub
Sub check
Dim req As HttpRequest
req.InitializeGet("http://www.name.com/test.php?hst=12.123.123.12")
httpC.Execute(req,1)
End Sub
Sub httpC_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Dim result As String
result = Response.GetString("UTF8")
Log(result,"")
End Sub
Sub httpC_ResponseError (Response As HttpResponse, why As String, StatusCode As Int, TaskId As Int)
Msgbox("Connection error "&why,"Error ("&StatusCode&")")
End Sub