Status Content Selector

Status Content Selector

This content allows to specify child contents depending on the status code that the behaviour layer selected. This allows to forward a request to the proxy if it is a successful status code, or fake it with some local file (or use empty response), for other status codes.

"content": {
  "source": "status_content_selector",
  "config": {
    "default_content": {
      "source": "stats",
      "config": {}
    },
    "status_contents": [
      {
        "from": 201,
        "to": 202,
        "content": {
          "source": "file",
          "config": {
            "path": "./example/data/201_created.json"
          }
        }
      },
      {
        "from": 202,
        "to": 203,
        "content": {
          "source": "file",
          "config": {
            "path": "./example/data/202_accepted.json"
          }
        }
      }
    ]
  }
}