Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Using HttpModifier to set Target Proxy URL Context

Hi,

I noticed in this https://cloud.google.com/apigee/docs/api-platform/reference/policies/http-modifier-policy#set-path

This element isn't currently working as designed to override/rewrite a proxy's target URL.

Sometimes you may need to send a message to a URL other than the URL defined in an API proxy's TargetEndpoint. (You can't override target.url in the ProxyEndpoint, because Apigee sets the variable in the TargetEndpoint).

Is there an alternate way to do this?

Thanks,

Kyle

 

Solved Solved
0 4 218
1 ACCEPTED SOLUTION

Just to follow up, Using a JS policy to update target.url worked.

if (context.flow=="TARGET_REQ_FLOW") {
     var target_url = context.getVariable("property_set_webhook_lookup");
     context.setVariable("target.url", "https://" + target_url + "/");
}

 

View solution in original post

4 REPLIES 4