Skip to Content
1

API Management: target.url and target.host is null in JavaScript in TargetEndpoint Preflow Policy

Mar 09 at 12:36 AM

29

avatar image

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/FileResource/saml.js 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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers