B4J Code Snippet [server] list all request headers in a handler class

B4X:
Dim jo As JavaObject = req
Dim collections As JavaObject
collections.InitializeStatic("java.util.Collections")
Dim headers As List = collections.RunMethod("list", Array(jo.RunMethodJO("getHeaderNames", Null)))
For Each h As String In headers
    Log(h & ": " & req.GetHeader(h))
Next
 

udg

Expert
Licensed User
Longtime User
Sub Handle(req As ServletRequest, resp As ServletResponse)
It's part of the signature of an handler. Look at those params as an IN/OUT couple, just to put it simply.
 
Top