Jxadro
Jxadro

Reputation: 1637

Is it possible to access to the HTTPRequest in the worklight adapter implementation?

Is is possible somehow to access the httprequest inside the code of the adater?

The root reason for asking this is a bit tricky...

I need to know the ip of the worklight server to use it later in the app for other uses.

From the app I have not found any API that could help.

Detect Worklight Server Hostname/IP Address from Worklight Client code In the server it was possible using the WL.Server.configuration["local.IPAddress"] to get the ip but that was static and now there is no "local.IPAddress". Any way this is static.

Using J2SE API is possible to access to the network interfaces but as there can be more than one it is not the best option.

I was thinking about using the httprequest getLocalAddres method that return the ip being invoked.

Thank you

Upvotes: 0

Views: 244

Answers (1)

Anton
Anton

Reputation: 3166

If you're talking about httprequest from client to WL server - yes, it is possible. you have WL.Server.getClientRequest() API

If you're talking about httprequest from WL server to backend - no, this is not possible. Adapter is used to abstract the need for direct usage of HTTP client internals.

Upvotes: 3

Related Questions