Page 1 of 1

Get Wan IP (api.ipify.org)

Posted: Thu Nov 10, 2016 2:55 pm
by falsam
To find the IP address of your visitors.

Code: Select all

Procedure HttpGetEvent(Success, Result$, UserData)
  Protected wanip.s
  
  If Success
    Debug Result$
    ParseJSON(0, Result$, #PB_UTF8)
    
    wanip = GetJSONString(GetJSONMember(JSONValue(0), "ip"))
    Debug "Your wan ip is : " + wanip 
    
  Else
    Debug "HTTPRequest(): Error"
  EndIf
EndProcedure

HTTPRequest(#PB_HTTP_Get, "https://api.ipify.org?format=json", "", @HttpGetEvent())