1
votes

I am calling a HTTP endpoint before my message reaches the apikit:router.

By the time the message reaches the apikit:router, it has lost all the original HTTP headers. Because of that the router is not able to figure out the intended method.

Actually I am able to copy the inbound properties in a session variable, after the HTTP call I am able to revert them as outbound property. Then I have my api router in another flow, so the outbound property gets coverted to inbound property again. This solution works fine, but the flow looks pretty ugly. (as I had to do this copy for about 10 headers)

Is there any better workaround ? Also I am trying to avoid manually dealing with these headers.

1

1 Answers

2
votes

Wrap the HTTP call within the enricher, it will preserve the http inbound properties and the payload of the original call. Like this,

<enricher target="#[flowVars.resultOfInnerHTTP] source="#[payload]">
  <http:request...../>
</enricher>
<apikit:router.../>