Added header values not getting in target endpoint

Not applicable

I am new in APIGEE. As part of this, we need to add a header component "Authorization" with value with a header. When we do this in direct API it works but when we trying to give this through APIGEE its doesn't. we have added a header value using 'Assign message policy'. But the added header value is not getting in our end point.I have added like this.

<Add>
        <Headers>
            <Header name="Authorization">123456</Header>
        </Headers>
</Add>
Solved Solved
1 3 2,702
1 ACCEPTED SOLUTION

you wrote:

I have added like this.

Where is that XML? Give me more context?

Normally you would set headers in an AssignMessage policy, and then attach that policy at some point in the proxy flow. You haven't mentioned or described either of those two things - the policy or the attachment point.

So can you clarify what you're doing? Provide more information, more context, on both of those things.

Also, try using Set , not Add.

<AssignMessage name='AM-1'>
  <AssignTo createNew='false' type='request'/>
  <Set>
    <Headers>
      <Header name='Authorization'>A12345</Header>
    </Headers>
  </Set>
</AssignMessage>

View solution in original post

3 REPLIES 3

you wrote:

I have added like this.

Where is that XML? Give me more context?

Normally you would set headers in an AssignMessage policy, and then attach that policy at some point in the proxy flow. You haven't mentioned or described either of those two things - the policy or the attachment point.

So can you clarify what you're doing? Provide more information, more context, on both of those things.

Also, try using Set , not Add.

<AssignMessage name='AM-1'>
  <AssignTo createNew='false' type='request'/>
  <Set>
    <Headers>
      <Header name='Authorization'>A12345</Header>
    </Headers>
  </Set>
</AssignMessage>

Thanks, DIno-at-Google. We didnt set as flow that was our mistake. as per your suggestion, we set policy and now it work like charm !!

Glad to hear it!