HTTP 调试

返回指定状态码的错误页面

GET/status/{code}/html
公开访问

支持 GET 和 HEAD。实际 HTTP 状态码与 code 一致,支持 400–599。已知状态码使用标准英文说明,未定义状态码显示 Unknown HTTP Status。参数无效时返回 HTTP 400 和 ApiError JSON。响应禁止缓存。 访问类别:匿名 API,可携带 Token 使用独立额度

请求参数

codepath必填
需要返回的 HTTP 错误状态码,范围 400–599
integer · 需要返回的 HTTP 错误状态码,范围 400–599 · 最小值:400 · 最大值:599

响应

400 code 为 400 时返回指定错误内容;请求校验或执行失败时返回 ApiError JSON

text/html

{
  "type": "string"
}

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
401 凭据无效、停用、过期或缺少所需 Token

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
403 需要管理员 Token

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
413 code 为 413 时返回指定错误内容;请求校验或执行失败时返回 ApiError JSON

text/html

{
  "type": "string"
}

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
415 code 为 415 时返回指定错误内容;请求校验或执行失败时返回 ApiError JSON

text/html

{
  "type": "string"
}

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
429 code 为 429 时返回指定错误内容;请求校验或执行失败时返回 ApiError JSON

text/html

{
  "type": "string"
}

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
500 code 为 500 时返回指定错误内容;请求校验或执行失败时返回 ApiError JSON

text/html

{
  "type": "string"
}

application/json

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "enum": [
                  "body",
                  "query",
                  "path",
                  "header"
                ]
              },
              "field": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "location",
              "field",
              "code",
              "message"
            ]
          }
        }
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
4XX 指定的客户端错误状态码

text/html

{
  "type": "string"
}
5XX 指定的服务器错误状态码

text/html

{
  "type": "string"
}

响应示例

运行命令前,将环境变量 BASE_URL 设置为站点地址。

成功响应

curl --silent --show-error -H 'User-Agent: simpleWebUtils-example/1.1.0' -H 'Accept: application/json' "$BASE_URL"'/status/404/html'
HTTP 404
content-type: text/html; charset=utf-8
content-encoding: gzip
cache-control: no-store

<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="theme-color" content="#fafafa"/><title>404 Not Found · simpleWebUtils</title><link nonce="f331e712-405a-4c6f-b557-499862cdee3f" rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png"/><link nonce="f331e712-405a-4c6f-b557-499862cdee3f" rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png"/><link nonce="f331e712-405a-4c6f-b557-499862cdee3f" rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link nonce="f331e712-405a-4c6f-b557-499862cdee3f" rel="manifest" href="/manifest.webmanifest"/><link rel="modulepreload" href="/assets/entry.client-DYfsZP93.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/rolldown-runtime-WkwZ5CU-.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/jsx-runtime-LQh6IV4L.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/react-dom-CWlARPGC.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/pwa-DdDwz6uo.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/application-activity-s7m2M4y6.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/root-DntOYtVh.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/lib-CcGib1t2.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/dist-F5XKT0m5.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/ui-C3GonqbC.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/icon-glwOXYyu.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/web-navigation-Cd2R85ud.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/token-store-BdkyA9wn.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/console-navigation-wqwMmn-2.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link rel="modulepreload" href="/assets/status-BgJN6crw.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"/><link nonce="f331e712-405a-4c6f-b557-499862cdee3f" rel="stylesheet" href="/assets/root-Ce3Jw83g.css"/><script src="/theme.js" nonce="f331e712-405a-4c6f-b557-499862cdee3f"></script></head><body><div class="workspace "><a class="skip-link" href="#main">跳到主要内容</a><aside class="desktop-sidebar"><a class="brand" href="/" data-discover="true"><span class="brand-icon"><svg data-prefix="fas" data-icon="terminal" class="svg-inline--fa fa-terminal" role="img" viewBox="0 0 512 512" aria-hidden="true"><path fill="currentColor" d="M9.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L146.7 256 9.4 118.6zM224 384l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"></path></svg></span><span>simpleWebUtils</span></a><nav class="sidebar-navigation" aria-label="API 分类"><a class="sidebar-home" href="/" data-discover="true"><svg data-prefix="fas" data-icon="book-open" class="svg-inline--fa fa-book-open" role="img" viewBox="0 0 512 512" aria-hidden="true"><path fill="currentColor" d="M256 141.3l0 309.3 .5-.2C311.1 427.7 369.7 416 428.8 416l19.2 0 0-320-19.2 0c-42.2 0-84
… 已截断,完整响应 42698 字符

错误示例

curl --silent --show-error -H 'User-Agent: simpleWebUtils-example/1.1.0' -H 'Accept: application/json' "$BASE_URL"'/status/-1/html'
HTTP 400
content-type: application/json
content-encoding: gzip
cache-control: no-store

{
  "error": {
    "code": "INVALID_INPUT",
    "message": "参数无效",
    "issues": [
      {
        "location": "path",
        "field": "code",
        "code": "invalid_format",
        "message": "格式要求:/^\\d+$/"
      }
    ]
  }
}

在线调试

必填
Ctrl / ⌘ + Enter
调用示例
curl -X GET 'https://oit.sh/status/404/html'

响应

等待请求

等待发送请求

配置上方请求参数后点击「发送请求」查看实时响应

快捷键:Ctrl / ⌘ + Enter