---
title: "Captcha Image"
method: GET
path: "/captcha"
---

# Captcha Image

`GET /captcha`

## Request

- Base URL: `https://api.twtapi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.twtapi.com/captcha`
- Auth: none declared

生成验证码图片，并把答案写入当前会话。

参数:
    request: 用于读取 session_id Cookie。

返回:
    image/png 响应体；若本次新建了会话，额外下发 Set-Cookie: session_id。

副作用:
    写 Redis（新增或覆盖会话中的 captcha 字段）。这里刻意复用已有会话而不是
    每次重建，否则用户在同一浏览器里开多个页面时，后一个页面的会话会把前一
    个页面的会话顶掉，导致前一个页面提交的验证码必然失效。

## Response `200`

Successful Response

- unknown

---

[API](https://skmtc.dev/twtapi/apis/twtapi-backend.md) · [All operations](https://skmtc.dev/twtapi/apis/twtapi-backend/llms.txt) · [OpenAPI document](https://skmtc.dev/twtapi/apis/twtapi-backend/revisions/5295976febaf?raw)
