AnsweredAssumed Answered

Context Variable for Hostname

Question asked by siddharth-b on Nov 23, 2017
Latest reply on Nov 24, 2017 by orrde01

Hi guys I am using Gateway 9.1.

My request URL to call services in Gateway is,

 

https://api.sample.com/poc/users/saml/23478

 

I want to get the above hostname(api.sample.com) in a variable. I tried using split variable assertion to split using "/"

Then I am getting below response,

${split_request_uri[0]} - gives empty

${split_request_uri[1]} - poc
${split_request_uri[2]} - users
${split_request_uri[3]} - saml
${split_request_uri[4]} - 23478
${request.url} - https://api.sample.com/poc/users/saml/23478
${request.tcp.localHost} - gives Gateway Node IP which is not what I want.

 

I also tried using split variable assertion to split using "//"

Then I am getting below response,

${split_request_uri[1]} - /poc/users/saml/23478

 

Any help is appreciated.

 

Thanks

Outcomes