on 03-09-2018 12:36 AM
Hi All,
I need to do an additional request to the backend before the original request.
So I have in the Policy in the TargetEndpoint Preflow a JavaScript call.
But I can't access the host I need for the url in "new Request(url, 'GET', headers)".
Both target.url and target.host are null, target.host is only filled in the PostFlow.
Eg the example JS File https://github.com/SAP/cloud-api-management-samples/blob/master/authentication/saml/APIProxy/FileRes... uses context.getVariable("target.url") which always null in my tests. so this will also not work.
Any idea how to solve this problem?
Thanks,
Wolfgang
Hi Wolfgang, Community,
I have the same challenge. I want to manipulate the destination/target URL. When a request URL: path/ZMY_ENTITY/{key} comes in I want to remove the {key} part from the URL and map it to a query parameter. Following the Apigee methods you need to adjust the target.url in the TargetEndPoint Preflow. Unfortunately this variable is empty in SAP API management during the Preflow event.
Did you solve this issue? Or how can it be solved?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi arjanboer ,
sorry for the late reponse. Caveat: I can only talk about reading, not about modifying stuff from target URL.
Eg target.basepath, context.targetRequest.uri and context.targetRequest.url is available in the target preflow.
For target.host after some discussion with SAP support we use the fixed string opproxyapimgmtpr-XXXXX.hana.ondemand.com where XXXXX is the technical subaccount name (on NEO, I don't have experience with API Management on CF).
Regards,
Wolfgang
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.