64
Views
5
Comments
Solved
HTTPRequestHandler / GetIp equivalent in ODC
Question
Application Type
Reactive

Hi!

I need to get the  IP host address of the remote client to complete some information in an audit log.

I have already developed something similar in Outsystems 11 using the system dependency HTTPRequestHandler  / GetIp.

I have searched online and in this forum and found a similar question by Jeff Barsness but I still miss the reference to the request elements.

The ODC HTTP library offers these "get" methods but none of them seems useful to get the IP host address of the remote client.


  • Request_GetCookie
  • Request_GetDomain
  • Request_GetFiles
  • Request_GetHeaders
  • Request_GetURL


Any ideas? Thanks in advance for your attention and support!


Marco

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

Hi Marco,

you can try to use the Request_GetHeaders action and query the X-Forwarded-For header.

Stefan

2025-04-15 10-28-35
Dhanasingh Dennison
Solution

Hi @Marco Del Dottore ,

1. Use Request Headers (X-Forwarded-For) 

  • Use Request_GetHeaders() to fetch all headers.
  • Extract X-Forwarded-For, which usually contains the client’s IP.

(or)

2. Use an External API (Fallback Option)

If you cannot obtain the IP directly, you could use an external IP detection service like:

      * https://api64.ipify.org/?format=json

      * https://checkip.amazonaws.com/

You can call these services via an HTTP request to fetch the client’s public IP.

Hope this helps,

Thanks,

Dhanasingh Dennison.

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

Hi Marco,

you can try to use the Request_GetHeaders action and query the X-Forwarded-For header.

Stefan

2025-04-15 10-28-35
Dhanasingh Dennison
Solution

Hi @Marco Del Dottore ,

1. Use Request Headers (X-Forwarded-For) 

  • Use Request_GetHeaders() to fetch all headers.
  • Extract X-Forwarded-For, which usually contains the client’s IP.

(or)

2. Use an External API (Fallback Option)

If you cannot obtain the IP directly, you could use an external IP detection service like:

      * https://api64.ipify.org/?format=json

      * https://checkip.amazonaws.com/

You can call these services via an HTTP request to fetch the client’s public IP.

Hope this helps,

Thanks,

Dhanasingh Dennison.

2022-06-28 11-14-07
Marco Del Dottore

Thanks a lot Stefan and Dhanasingh for your prompt reply and your kind help.

I will try to query for X-Forwarded-For as suggested.

Have a nice day!


Marco

2022-05-01 03-47-53
Jun Mun Chan

I have a similar use-case for this too. Would you be so nice to update whether Request Headers (X-Forwarded-For)  works for this?

Thank you!

2022-06-28 11-14-07
Marco Del Dottore

Hi Jun Mun.

Yes, I tried to fetch the "X-Forwarded-For" header and the function returns the correct IP.

Thanks again to Stefan and Dhanasingh 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.