跳到主要内容
版本:1.x

API04001: Invalid Response Format

What This Means

The server responded, but the response format is not what the POS expected. The server should return JSON data, but something else was received.

Common Causes

  • PHP error displayed — A PHP error is being output before JSON
  • Plugin conflict — Another plugin is outputting content
  • Maintenance mode — Site is showing a maintenance page
  • Wrong content type — Server sending HTML instead of JSON
  • Caching issue — A cached error page is being served

How to Fix

1. Check Your Site

Visit your WordPress site in a browser:

  • Is it displaying normally?
  • Are there any visible errors?
  • Is it in maintenance mode?

2. Check for PHP Errors

In wp-config.php, temporarily enable debugging:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Check wp-content/debug.log for errors.

3. Test the REST API Directly

Visit https://yoursite.com/wp-json/ in your browser:

  • Should return JSON data
  • If you see HTML or errors, there's a problem
  • Check for plugin-related output

4. Disable Caching Temporarily

Caching plugins may serve stale responses:

  • Clear all caches
  • Temporarily disable caching plugins
  • Exclude the REST API from caching

5. Check for Plugin Conflicts

If a plugin outputs content on every page:

  1. Disable all non-essential plugins
  2. Test the POS
  3. Re-enable plugins one by one