Debug

Test an an API definition.

Used to test API definition by sending sample request and analysing output of both response and logs.

post/tyk/debug

Request body

Example request

{
  "request": {
    "method": "GET",
    "path": "/keyless-test/"
  },
  "spec": {
    "CORS": {
      "allowed_headers": [
        "Origin",
        "Accept",
        "Content-Type",
        "Authorization"
      ],
      "allowed_methods": [
        "GET",
        "HEAD",
        "POST"
      ],
      "allowed_origins": [
        "https://*.foo.com"
      ],
      "debug": true,
      "exposed_headers": [
        "Accept",
        "Content-Type"
      ],
      "max_age": 24
    },
    "auth": {
      "auth_header_name": "Authorization"
    },
    "cache_options": {
      "cache_timeout": 60,
      "enable_cache": true
    },
    "custom_middleware": {
      "auth_check": {
        "name": "PreMiddlewareFunction"
      },
      "post": [
        {
          "name": "PreMiddlewareFunction"
        }
      ],
      "post_key_auth": [
        {
          "name": "PreMiddlewareFunction"
        }
      ],
      "pre": [
        {
          "name": "PreMiddlewareFunction"
        }
      ],
      "response": [
        {
          "name": "PreMiddlewareFunction"
        }
      ]
    },
    "definition": {
      "key": "x-api-version",
      "location": "header"
    },
    "proxy": {
      "listen_path": "/relative-path-examples/",
      "strip_listen_path": true,
      "target_url": "https://httpbin.org/"
    },
    "tags": [
      "Default",
      "v1"
    ]
  }
}

Response

Success tracing request.

logsstring
messagestring
responsestring

Example response

{
  "logs": "{\"level\":\"warning\",\"msg\":\"Legacy path detected! Upgrade to extended....",
  "message": "ok",
  "response": "====== Request ======\nGET / HTTP/1.1\r\nHost: httpbin.org\r\n\r\n\n====== Response..."
}

Changes