Hello all,
I am stuck with the code to use substring in javascript to extract the part of URL.
https://abc.com:9001/xyz/myrequest
I need to extract only /xyz
Thanks in advance.
Solved! Go to Solution.
Change to "print" , as I said refer to Apigee javascript samples and make adjustments.
print("Original address: "+url_add)
print(break_address(url_add))
Thank you everyone for your valuable time. Preferably I wanted to use only Javascript to reduce the redundancy of adding extra policies. I used the below script and it worked.
const supplyUrl = "https://my.supplier/supplier/tariffSelectionG_E5449168?t=randomChars" if(supplyUrl.includes('?')) { const url = supplyUrl.split('?') if(url.length > 0) { const tariff = url[0].split('supplier/') console.log('tariff:', tariff[1]) } }