Title: REST API Route Tester
Author: Nowshad Jawad
Published: <strong>2025 年 5 月 29 日</strong>
Last modified: 2026 年 5 月 21 日

---

搜索插件

![](https://ps.w.org/rest-api-route-tester/assets/banner-772*250.png?rev=3302611)

![](https://ps.w.org/rest-api-route-tester/assets/icon-256*256.png?rev=3302611)

# REST API Route Tester

 作者：[Nowshad Jawad](https://profiles.wordpress.org/jawad0501/)

[下载](https://downloads.wordpress.org/plugin/rest-api-route-tester.1.5.0.zip)

 * [详情](https://cn.wordpress.org/plugins/rest-api-route-tester/#description)
 * [评价](https://cn.wordpress.org/plugins/rest-api-route-tester/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/rest-api-route-tester/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/rest-api-route-tester/#developers)

 [支持](https://wordpress.org/support/plugin/rest-api-route-tester/)

## 描述

REST API Route Tester is a powerful tool for WordPress developers and administrators
to test and debug REST API endpoints. It provides a user-friendly interface to:

 * View all registered REST API routes
 * Test routes with different HTTP methods (GET, POST, PUT, PATCH, DELETE, OPTIONS,
   HEAD)
 * Switch between different user roles to test permissions
 * Send custom headers and body data
 * View detailed responses including status codes and timing
 * Request history and saved requests with full state restore
 * WordPress 7.0 AI helpers: explain responses and suggest request bodies (when 
   Connectors are configured)
 * Abilities API integration for agent workflows

## 屏幕截图

[[

[[

[[

[[

[[

[[

## 安装

 1. Upload the plugin files to the `/wp-content/plugins/rest-api-route-tester` directory,
    or install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Use the Tools->REST Route Tester screen to use the plugin

## 常见问题

### What permissions do I need to use this plugin?

You need to have the ‘manage_options’ capability to use this plugin, which is typically
granted to administrators.

### Can I test authenticated endpoints?

Yes, you can test authenticated endpoints by selecting different user roles from
the dropdown menu.

### How do I report bugs and request features?

Please open a topic in our WordPress.org support forum with:

 * WordPress version and PHP version
 * Route and HTTP method
 * Headers/body sample (remove secrets)
 * Expected result vs actual result

Support forum: https://wordpress.org/support/plugin/rest-api-route-tester/

## 评价

此插件暂无评价。

## 贡献者及开发者

「REST API Route Tester」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Nowshad Jawad ](https://profiles.wordpress.org/jawad0501/)

[帮助将「REST API Route Tester」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/rest-api-route-tester)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/rest-api-route-tester/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/rest-api-route-tester/)，或通过[RSS](https://plugins.trac.wordpress.org/log/rest-api-route-tester/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/rest-api-route-tester/)。

## 更新日志

#### 1.5.0

 * Tested up to WordPress 7.0
 * Fixed: custom headers and GET query parameters are now applied to REST requests
 * Fixed: capability checks on all AJAX endpoints; safer JSON handling for headers/
   body
 * Fixed: saved requests persist role, auth preset, and URL parameters
 * Added: Request history tab (last 50 tests) with one-click restore
 * Added: Explain response and Suggest body using WP AI Client (WordPress 7.0+)
 * Added: Abilities `wprrt/list-rest-routes` and `wprrt/test-rest-route`
 * Improved: namespace-based route filter (e.g. wp/v2); admin UI polish for WP 7.0

#### 1.4.1

 * Fixed role-based testing: REST permission checks now evaluate as the selected
   role or guest, not the logged-in administrator
 * Added Guest (logged-out user) option for testing public vs authenticated routes
 * Restored original user context and removed temporary filters after each test 
   request

#### 1.4.0

 * Added URL parameter inputs for routes containing tokens such as `{id}`
 * Param values are URL-encoded, substituted at send time, and persisted in localStorage
 * Added “Copy as cURL” button with method, resolved URL, headers, and body
 * Fixed resolved-route validation against regex-based WordPress route patterns
 * Fixed route display formatting for complex regex-style parameters (named captures
   now render as clean `{param}` tokens)
 * Added `rest_url` in `wprrt_vars` for more accurate generated cURL commands
 * Added JS modules: `src/params.js` and `src/export.js`

#### 1.3.0

 * Added Saved Requests sidebar — save any request by name, click to restore into
   active tab
 * Added auth preset dropdown (No Auth, Bearer Token, API Key, Basic Auth) — auto-
   fills Headers field
 * Saved requests persisted per-user in wp_usermeta (max 100, newest first)
 * New PHP class WPRRT_Saved_Requests with save, get_all, delete methods
 * New AJAX actions: wprrt_save_request, wprrt_get_saved_requests, wprrt_delete_request
 * Auth type selection persisted in localStorage tab state
 * Two-column layout: sidebar left, request/response right

#### 1.2.0

 * Introduced Vite build system — source now lives in src/ and compiles to assets/
   app.js
 * Modular JS architecture: state.js, tabs.js, request.js, response.js, main.js
 * Added PrismJS syntax highlighting for JSON responses (GitHub-flavoured light 
   theme)
 * Build commands: npm run build (production), npm run dev (watch mode)
 * Fixed: empty request body was rejected with “Invalid JSON data” — empty string
   now correctly defaults to {}

#### 1.1.0

 * Security: Fixed XSS vulnerability in route dropdown — route names now inserted
   via textContent, never innerHTML
 * Security: test_route() now wrapped in try/finally so temporary test users are
   always deleted
 * Security: Added 512 KB payload size limit on request body
 * Security: Added route existence validation — unknown routes are rejected before
   execution
 * Added support for PATCH, OPTIONS, and HEAD HTTP methods
 * Response now returns HTTP status code and response headers alongside body data
 * Response panel now shows a color-coded status badge (2xx green, 3xx blue, 4xx
   yellow, 5xx red)
 * Response time displayed as a readable line above the body, not embedded in JSON
 * Added collapsible Response Headers section in the response panel
 * Fixed formatRoute() regex to correctly handle optional parameter groups
 * AJAX failures now show a visible inline error message instead of a silent blank
   state
 * Removed all debug console.log() calls from production JS
 * Removed permanently-hidden dead “Form Params” field
 * JS globals wrapped in WPRRT namespace object to avoid conflicts

#### 1.0.0

 * Initial release

## 额外信息

 *  版本 **1.5.0**
 *  最后更新：**3 周前**
 *  活跃安装数量 **50+**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **7.0**
 *  PHP 版本 ** 8.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/rest-api-route-tester/)
 * 标签
 * [api](https://cn.wordpress.org/plugins/tags/api/)[developer-tools](https://cn.wordpress.org/plugins/tags/developer-tools/)
   [rest-api](https://cn.wordpress.org/plugins/tags/rest-api/)[testing](https://cn.wordpress.org/plugins/tags/testing/)
 *  [高级视图](https://cn.wordpress.org/plugins/rest-api-route-tester/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/rest-api-route-tester/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/rest-api-route-tester/reviews/)

## 贡献者

 *   [ Nowshad Jawad ](https://profiles.wordpress.org/jawad0501/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/rest-api-route-tester/)