This section provides information about the response-simulator tool available under the /en/api-docs/tools/response-simulator endpoint.

Overview

The response-simulator tool is designed to simulate various HTTP response scenarios for testing purposes. It allows users to define custom response codes, headers, and body content to mimic different server responses.

Features

  • Custom Response Codes: Simulate HTTP response codes such as 200, 404, 500, etc.
  • Custom Headers: Add custom headers to the response, like Content-Type, Cache-Control, etc.
  • Custom Body Content: Define the body content of the response in different formats like JSON, XML, or plain text.

Usage

To use the response-simulator, send a GET request to the following endpoint:

GET /en/api-docs/tools/response-simulator

Query Parameters

  • code: (Optional) The HTTP response code to simulate.
  • headers: (Optional) A JSON object containing custom headers.
  • body: (Optional) The body content of the response.

Example:

GET /en/api-docs/tools/response-simulator?code=404&headers={"Content-Type": "application/json"}&body={"error": "Not Found"}

Example Response

{
  "status": 404,
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "error": "Not Found"
  }
}

For more information on using the API, please refer to our API Documentation.

Related Resources


simulator_api

The response-simulator tool is a powerful tool for testing and debugging HTTP responses. By using this tool, you can ensure your applications handle different response scenarios correctly.