0

I have an API (POST) hosted on apache server, which I want to proxy it to another server. I have done it by using ProxyPass feature. Following is the excerpt:

<VirtualHost *:80>
  ServerName mydomain 
  ServerAlias *.mydomain 
  ProxyPass /myAPI/ redirectedServer/redirectedAPI/ 
</VirtualHost>

How ever, I want to add custom headers to the request, based on the value set in one of the parameters in POST request. For e.g. sample requests can be

{"key":"value1"}, {"key":"value2"}

based on the value of "key" coming in the POST request, I want to add different custom headers {"token":{"value_for_value1"}},{"token":{"value_for_value2 "}}

I was checking the documentation of ReWriteRule/ReWriteMap, but couldn't understand as to how to do it. Can someone please help me?

jeangrey
  • 33
  • 5
  • Are the keys different post parameters or are they part of JSON data posted in a single POST parameter? – Capsule May 29 '17 at 04:04
  • @Capsule the key via which the header value is determined, is a part of incoming post request itself. – jeangrey May 29 '17 at 06:07
  • Yeah but how does the whole POST request look like? Please add a detailed view of the HTTP request. – Capsule May 30 '17 at 23:51

0 Answers0