Jump to content
Welcome to our new Citrix community!

How to use http callout for extracting country code.


Smrutimaya Mohanty

Recommended Posts

We have this API, which gives country code in below format, if we pass the IP.

 

API path - https://webserver-host/url/127.0.0.1

 

Response - {"location":"XB","channel":"00","ip":"127.0.0.1"}

 

We need to extract the location code as the response.

 

This is what I have configured - 

 

add policy httpCallout GeoLocation -IPAddress 10.10.10.10 -port 443 -returnType TEXT -hostExpr "\"webserver-host\"" -urlStemExpr "url/" + CLIENT.IP.SRC" -scheme http -resultExpr "HTTP.RES.BODY(1000)"

 

I don't know on which expression I should use to extract the required content from the response.

Also please advise, if any correction required on the configuration.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...