Add multiple headers by passing each header:value pair separately:
curl -X POST http://localhost:8001/services/httpbin/plugins \
--data "name=request-transformer-advanced" \
--data "config.add.headers[1]=h1:v1" \
--data "config.add.headers[2]=h2:v1"
Incoming Request Headers |
Upstream Proxied Headers |
h1: v1 |
h1: v1, h2: v1 |
Add multiple headers by passing comma separated header:value pair:
curl -X POST http://localhost:8001/services/httpbin/plugins \
--data "name=request-transformer-advanced" \
--data "config.add.headers=h1:v1,h2:v2"
Incoming Request Headers |
Upstream Proxied Headers |
h1: v1 |
h1: v1, h2: v1 |
Config as JSON body
Add multiple headers passing config as a JSON body:
curl -X POST http://localhost:8001/services/httpbin/plugins \
--header 'content-type: application/json' \
--data '{"name": "request-transformer-advanced", "config": {"add": {"headers": ["h1:v2", "h2:v1"]}}}'
Incoming Request Headers |
Upstream Proxied Headers |
h1: v1 |
h1: v1, h2: v1 |
Multiple headers and query strings
Add multiple headers and query string parameters if not already set:
curl -X POST http://localhost:8001/services/httpbin/plugins \
--data "name=request-transformer-advanced" \
--data "config.add.headers=h1:v1,h2:v1" \
--data "config.add.querystring=q1:v2,q2:v1" \
Incoming Request Headers |
Upstream Proxied Headers |
h1: v1 |
h1: v1, h2: v1 |
h3: v1 |
h1: v1, h2: v1, h3: v1 |
Incoming Request Query String |
Upstream Proxied Query String |
?q1=v1 |
?q1=v1&q2=v1 |
|
?q1=v2&q2=v1 |
Example: Adding a querystring and a header
curl -X POST http://localhost:8001/services/httpbin/plugins \
--data "name=request-transformer-advanced" \
--data "config.add.querystring=q1:v2,q2=v1" \
--data "config.add.headers=h1:v1"
Incoming Request Headers |
Upstream Proxied Headers |
h1: v1 |
h1: v1, h2: v1 |
h3: v1 |
h1: v1, h2: v1, h3: v1 |
Incoming Request Query String |
Upstream Proxied Query String |
?q1=v1 |
?q1=v1&q2=v1 |
|
?q1=v2&q2=v1 |
Example: Appending and removing in one request
Append multiple headers and remove a body parameter:
curl -X POST http://localhost:8001/services/httpbin/plugins \
--data "name=request-transformer-advanced" \
--data "config.append.headers=h1:v2,h2:v1" \
--data "config.remove.body=p1" \
Incoming Request Headers |
Upstream Proxied Headers |
h1: v1 |
h1: v1, v2, h2: v1 |
Incoming URL Encoded Body |
Upstream Proxied URL Encoded Body |
p1=v1&p2=v1 |
p2=v1 |
p2=v1 |
p2=v1 |