The proxy-request action forwards the incoming request almost unmodified to an upstream system.
The HTTP method and the request body are taken as-is from the client request.
Cookie, Authorization and any hop-by-hop header fields like Connection
will be automatically dropped.
The response body is written into fit://request/content/main where it
can be directly accessed with the content() function.
Additional information about the response, such as headers and status code can
be found in the $upstream variable.
Just like an ordinary request the proxy-request
can be configured using a JSON template
with the following properties:
Sets the URL to the upstream system.
Sets the request headers. The syntax is the same as in the request action.
Sets request options. See the request action options for valid options.
<flow>
<proxy-request>
{
"url": "https://example.com/api/",
"headers": {
"X-API-Key": "foo42bar"
},
"options": {
"exit-on-error": true,
"definition": "upstream.yaml",
"validate-request": true,
"validate-response": true
}
}
</proxy-request>
</flow>