1

my APIConnect API running on Bluemix is calling another API and I want to remove the User-Agent Header. I am using apim.setvariable in a Gatewayscript. Its working for some (e.g. Origin, Referer, ...) but not for the User-Agent. The User-Agent is still there.

apim.setvariable('message.headers.X-IBM-Client-Id', 'null','clear');
apim.setvariable('message.headers.X-IBM-Client-Secret', 'null', 'clear');
apim.setvariable('message.headers.Origin', 'null', 'clear');
apim.setvariable('message.headers.Referer', 'null', 'clear');
apim.setvariable('message.headers.X-Client-IP', 'null', 'clear');

apim.setvariable('request.headers.user-agent', 'null', 'clear');
apim.setvariable('request.headers.User-Agent', 'null', 'clear');
apim.setvariable('message.headers.user-agent', 'null', 'clear');
apim.setvariable('message.headers.User-Agent', 'null', 'clear');

How can I remove the User-Agent header?

Thx

1 Answer 1

1

Make sure you're using a Proxy node instead of an Invoke node after your gateway script.

Sign up to request clarification or add additional context in comments.

3 Comments

Changed from Invoke to Proxy, but it does not solve the problem. User-Agent Header is still there.
What happens if you set it in a "set variable" policy?
still the same - User-Agent header is passed to the called API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.