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 -
example.com
Also tried by adding in Assign Message Policy with following variable-
target.header.Host
www.google.com
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>
@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>
@priyadarshi Ajitav Jena
I have added in a similar way but no luck, it’s not appearing in CURL sent to the target server.
<br> <Set><br> <Headers><br> <Header name="Host">example.com</Header><br> </Headers><br> </Set><br>
|
@Sachin Markapuram
Tried with this syntax also(code added in the above comment) but still not working
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.