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