I have added "Host" header to target request flow but when I see in trace tool curl command it's not getting passed to target server. I have put that Host header using Assign message policy -
<Set>
<Headers>
<Header name="Host">example.com</Header>
</Headers>
</Set>
Also tried by adding in Assign Message Policy with following variable-
<AssignVariable>
<Name>target.header.Host</Name>
<Value>www.google.com</Value>
</AssignVariable>
Attached this policy in target request preflow Any steps to resolve this?
Try as below.
<Set> <Headers> <Header name='Host'>example.com</Header> </Headers> </Set>
@priyadarshi Ajitav Jena
I have added in a similar way but no luck, it's not appearing in CURL sent to the target server.
<Set> <Headers> <Header name="Host">example.com</Header> </Headers> </Set> |
Actually, Host is a read only header in apigee. It gets set to the url automatically which cannot be changed.
I would suggest you to use Host query param if you want a custom variable with the same name.
@Nagesh Within the Assign message, you can use the below format to set the header name and value accordingly
<Set>
<Headers> <Header name="Content-Type">application/json</Header> <Header name="Connection">Keep-Alive</Header> </Headers> </Set>
Tried with this syntax also(code added in the above comment) but still not working
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |