🔍

首页Home › 开发工具Developer Tools

📮 在线接口测试(简易 Postman)Online API Tester (Postman-style)

在浏览器里直接发 HTTP 请求测试接口:支持 GET/POST/PUT/PATCH/DELETE 等方法、参数表、请求头、JSON/表单/文件请求体、Bearer/Basic/API Key 认证和 {{环境变量}},响应可美化、树形查看和预览,能导入 cURL、生成代码,历史和收藏保存在本地。Send HTTP requests from your browser to test APIs: GET/POST/PUT/PATCH/DELETE, query params, headers, JSON/form/multipart/file bodies, Bearer/Basic/API-key auth and {{variables}}; pretty, tree and preview response views, cURL import, code export, local history and collections.

参数表和地址栏双向同步。The table and the URL query string stay in sync.

填好地址后点“发送”,响应会显示在这里。Enter a URL and press Send; the response appears here.

历史、收藏和环境变量只保存在你这台设备的浏览器里。History, collections and variables are stored only in this browser.

使用说明与常见问题How-to & FAQ

「在线接口测试(简易 Postman)」是什么?What is the Online API Tester (Postman-style)?

在浏览器里直接发 HTTP 请求测试接口:支持 GET/POST/PUT/PATCH/DELETE 等方法、参数表、请求头、JSON/表单/文件请求体、Bearer/Basic/API Key 认证和 {{环境变量}},响应可美化、树形查看和预览,能导入 cURL、生成代码,历史和收藏保存在本地。Send HTTP requests from your browser to test APIs: GET/POST/PUT/PATCH/DELETE, query params, headers, JSON/form/multipart/file bodies, Bearer/Basic/API-key auth and {{variables}}; pretty, tree and preview response views, cURL import, code export, local history and collections.

如何使用「在线接口测试(简易 Postman)」?How do I use the Online API Tester (Postman-style)?

选择请求方法、填写地址,在“参数”“请求头”“请求体”“认证”里按需填写,点“发送”(或按 Ctrl+Enter)即可看到状态码、耗时、大小、响应头和响应体。也可以把 cURL 命令直接粘贴到地址栏导入,或点“生成代码”导出 cURL、fetch、Axios、Python requests。Pick a method, enter the URL, fill in Params, Headers, Body and Auth as needed, then press Send (or Ctrl+Enter) to see the status, time, size, headers and body. Paste a cURL command into the URL bar to import it, or use Code to export cURL, fetch, Axios or Python requests.

为什么提示跨域(CORS)错误?Why do I get a CORS error?

网页里发出的请求受浏览器跨域规则限制:目标服务器必须在响应里返回 Access-Control-Allow-Origin 等跨域响应头,页面才能读取结果。自己的接口可以在服务端开启 CORS;第三方接口可以复制工具给出的 cURL 命令在终端里运行。失败时工具会自动探测服务器能否连通,帮你区分是跨域限制还是网络问题。Requests made by a web page follow the browser's CORS rules: the server must return Access-Control-Allow-Origin (and related headers) for the page to read the response. Enable CORS on your own API, or run the cURL command the tool gives you in a terminal for third-party APIs. On failure the tool probes whether the server is reachable to tell CORS apart from network errors.

和 Postman、FeHelper 有什么区别?How is it different from Postman or FeHelper?

Postman 是桌面软件,FeHelper 是浏览器插件,都不受网页跨域规则限制;本工具是普通网页,打开即用、无需安装,请求从你的浏览器直接发出,本站不做任何代理中转。因此只能请求允许跨域的接口(例如自己开发的接口、本机 localhost 接口和公开 API),而且 Cookie、Host、Origin 等请求头由浏览器控制,不能手动设置。Postman is a desktop app and FeHelper a browser extension, so neither is bound by web CORS rules. This tool is a plain web page with nothing to install; requests go straight from your browser and this site relays nothing. It therefore works with CORS-enabled APIs (your own, localhost and public APIs), and browser-controlled headers such as Cookie, Host and Origin cannot be set.

可以测试本机 localhost 的接口吗?Can I test a localhost API?

可以。浏览器允许 HTTPS 页面请求 http://localhost 和 http://127.0.0.1,前提是本地服务开启了 CORS(例如返回 Access-Control-Allow-Origin: *)。新版 Chrome 和 Edge 第一次访问本机或局域网地址时,会弹出访问本地网络的权限请求,点“允许”即可。Yes. Browsers let HTTPS pages call http://localhost and http://127.0.0.1 as long as your local server enables CORS (e.g. Access-Control-Allow-Origin: *). Recent Chrome and Edge ask for local-network permission the first time; choose Allow.

环境变量怎么用?How do environment variables work?

在“变量”里新建环境并添加变量,比如 base = https://api.example.com、token = abc,然后在地址、参数、请求头、请求体或认证里写 {{base}}/users、Bearer {{token}},发送时会自动替换。切换环境就能在测试环境和正式环境之间切换。Create an environment under Variables, add e.g. base = https://api.example.com and token = abc, then write {{base}}/users or Bearer {{token}} in the URL, params, headers, body or auth; they are substituted when you send. Switch environments to move between staging and production.

「在线接口测试(简易 Postman)」免费吗?数据会经过本站吗?Is the Online API Tester (Postman-style) free? Does my data pass through this site?

「在线接口测试」完全免费,无需注册或安装。请求从你的浏览器直接发到你填写的地址,不经过本站服务器;历史记录、收藏和环境变量只保存在你这台设备的浏览器里,可以随时导出或清空。The Online API Tester is free with no sign-up or install. Requests go directly from your browser to the URL you enter, never through this site's servers; history, collections and variables stay in this browser and can be exported or cleared at any time.

相关工具Related tools

🌀 cURL 转代码cURL to Fetch / Python Converter📡 Curl 转代码Curl to Code📮 Postman 批量编辑格式转换Postman Bulk Edit Converter🔌 WebSocket 在线测试WebSocket Tester📡 SSE 测试器SSE Tester🚦 HTTP 状态码大全HTTP Status Codes List📨 HTTP 请求头解析HTTP Header Parser🧾 JSON 格式化校验JSON Formatter & Validator🎫 JWT 解码JWT Decoder🧩 URL 解析器URL Parser🔀 HTTP 请求方法大全HTTP Request Methods🕵️ User-Agent 解析User Agent Parser

← 全部工具All tools