static

Version

Sets the message body to static content. The body is either provided inline as text content or loaded from a file/URL. If pretty is enabled, the formatted result is cached and reused until the interceptor is (re)initialized.
api:
flow:
- static:
contentType: application/json
pretty: true
src: { "status": "ok" }
api:
    flow:
      - static:
          contentType: application/json
          pretty: true
          src: { "status": "ok" }

Syntax

static:
charset: <string>
contentType: <string>
location: <string>
pretty: <boolean>
src: <string>
static:
  charset: <string>
  contentType: <string>
  location: <string>
  pretty: <boolean>
  src: <string>

Attributes

NameRequiredDefaultDescriptionExamples
charsetfalseUTF-8Encoding of the template text.UTF-16, iso-8859-1
contentTypefalsetext/plainContent-Type of the generated body content.application/json
locationfalseN/AA file or URL location where the content that should be set as body could be foundconf/body.txt
prettyfalsefalseFormat the content of the template. Depending on the contentType the a formatter for JSON, XML or plain text is used.true
srcfalse---

Can be used in