hi, i am working with http server from b4j an traying get body to de server.
b4j y not an client y a web server for handling route reques.
i have this code
i cant get the post body from de client.
b4j y not an client y a web server for handling route reques.
i have this code
B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
mreq = req
mresp = resp
resp.ContentType = "text/json"
If (req.Method = "POST") Then
resp.Write(req.CharacterEncoding)
resp.Write(req.ContentLength)
resp.Write(req.ContentType)
Dim data As String
Dim in As InputStream
Dim bconv As ByteConverter
in = req.InputStream
data = bconv.StringFromBytes(in,"UTF8")
resp.Write(data)
End If
End Sub
i cant get the post body from de client.