Android Question httpServer (b4a vs b4j) handle requests

mc73

Well-Known Member
Licensed User
Longtime User
In b4j I read the content of the request, using
Code:
myContent=ReadObject(req.InputStream)
Code:
Public Sub ReadObject (In As InputStream) As Object
   Dim out As OutputStream
   out.InitializeToBytesArray(0)
   File.Copy2(In, out)
   Dim raf2 As RandomAccessFile
   raf2.Initialize3(out.ToBytesArray, False)
   Dim res As Object = raf2.ReadObject(0)
   raf2.Close
   Return res
End Sub
I want to do the same with the httpServer in b4a, but can't seem to find how to read the servlet's inputStream. I know I can use the post method, still, it would be nice to do the same, for compatibility reasons. Is it something simple?
 
Never mind, altered the b4j subroutine, using the getParameter function.
However, I still suppose that it would be nice to add the inputStream to the serverlet object of the b4a lib :)
 
Upvote 0
Back
Top