Hello,
I'm facing some difficulty handling an XML response back from the server and would greatly appreciate any assistance with this.
I have declared and initialized the client I believe correctly under Process Globals:
Then I have my request in my sub as follows:
And lastly I have my sub to handle the response:
Unfortunately I have found that the nothing is coming into Result and nothing is logged either. When I saved the stream into a file it works fine but I cannot seem to be able to handle the stream directly?
Any ideas or help will be greatly appreciated.
Thanks.
I'm facing some difficulty handling an XML response back from the server and would greatly appreciate any assistance with this.
I have declared and initialized the client I believe correctly under Process Globals:
B4X:
Dim hc As HttpClient
Then I have my request in my sub as follows:
B4X:
hc.Initialize("hc")
Dim req As HttpRequest
req.InitializeGet("http://myserveraddress.com---)
hc.Execute(req, 1)
And lastly I have my sub to handle the response:
B4X:
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Dim Result As InputStream
Result = Response.GetInputStream
Log(Result)
'Work with the Result here
Result.Close
End Sub
Unfortunately I have found that the nothing is coming into Result and nothing is logged either. When I saved the stream into a file it works fine but I cannot seem to be able to handle the stream directly?
Any ideas or help will be greatly appreciated.
Thanks.