user3165854
user3165854

Reputation: 1655

Add authorization from REST client to http request in mule

We have the authorization header sent from a REST client and this can be seen in the inbound properties after the HTTP listener connector at the start of the mule flow in 3.7.

We call an API in the same flow using a http request configurator and want to send the same authorization header in the call.

We have added it as a header in the parameter section in the http request configurator but it fails. How do we do this?

Upvotes: 0

Views: 748

Answers (2)

Ryan Carter
Ryan Carter

Reputation: 11606

You can directly copy the Authorization property using the copy-properties message processor, something like below:

<http:listener config-ref="HTTP_Listener_Configuration" path="/" allowedMethods="GET" doc:name="HTTP"/>

<copy-properties propertyName="Authorization" doc:name="Property" />

<http:request config-ref="HTTP_Request" path="/test" method="GET" doc:name="HTTP"/>

Upvotes: 1

Janthem
Janthem

Reputation: 31

I think you need to use a Message Property component and set your authorization in an Outbound Property before calling your HTTP:

enter image description here

Your Property will be:

enter image description here

I hope this can help you.

Upvotes: 0

Related Questions