Issue with KVM while configuring protocol under HTTPTargetConnection,Issues with KVM to configure HTTPTargetConnection

I tried to configure protocol under HTTPTargetConnection using KVM, but its failing by giving error Target protocol not specified.

<HTTPTargetConnection>

<URL>{protocol}mocktarget.apigee.net/{dataType}/{mock}</URL>

</HTTPTargetConnection>


Error that I am getting is :

Target Target default: Unsupported protocol in {securedProtocol}://mocktarget.apigee.net/{dataType}/{mock}. Protocol must be http or https.

Whereas based on apigee documentation it can be done :

https://docs.apigee.com/api-platform/cache/key-value-maps

Can somebody please help on this by sharing one example ?

,

I tried configuring HTTPTargetConnection using KVM

<HTTPTargetConnection>

<URL>{protocol}/{url}/{path}</URL>

</HTTPTargetConnection>

the problem is KVM resolves to the value when we configure protocol (http/https) OR the domain/url , it only works when we configure the base path like /get or /json , where as apigee mentions that we can configure protocol as well using KV as per the below link:

https://docs.apigee.com/api-platform/cache/key-value-maps

If somebody have done it please share an example...

0 1 75
1 REPLY 1

You cannot configure the protocol as variable here in target connection. You need to specify whether http or https.

If you hav conditional protocol, then use target.url variable setting in target endpoint using a javascript or assign message with condition.

Mostly all companies use https, http would be a lower environment backend.