I am trying to simulate the following curl statement
curl -k -H "username: Your API Username" -H "password: Your API Password" https://infoconnect1.highwayinfo.govt.nz/ic/jbi/TrafficCameras/REST/FeedService/
How do I use mappedRequestHeaders to inject username and password into http-client stream?
I think what you're trying to do can be achieved by enriching the message flow with the two headers you want and then using
mappedRequestHeaders
to specify that those should be propagated.Something like this:
where enrich.groovy adds
username
andpassword
as headers in the Spring Integration message.This does call out for an easy way to pass http headers though, maybe as an option to the module. I created https://jira.spring.io/browse/XD-2372 to track this, if you're interested