...
Here is an example of a pipeline which accesses the header attribute contentType
and writes it to the body:
Code Block | ||
---|---|---|
| ||
headers: contentType: "text/plain" pipeline: - body.set: value: "The type is: ${headers.contentType}" |
...
Here is an example which defines an initial body value and replaces this with another text in the pipeline:
Code Block | ||
---|---|---|
| ||
body: "Hello World" pipeline: - body.set: value: "The text from body is: ${body}" |
...
Here is an example which sets the HTTP 401 on the current request:
Code Block | ||
---|---|---|
| ||
pipeline: - body.set: ${context.response.statusCode = 401} |
...
You can also use the command http.response.set in order to set the response values:
Code Block | ||
---|---|---|
| ||
pipeline: - http.response.set: statusCode: 401 headers: X-Special: "MyValue" |
...
A key-value map of all HTT request query parameters of the current request.
Example:
Code Block | ||
---|---|---|
| ||
pipeline: - body.set: "This pipeline was called with id: ${request.params['id']'}" |
...