Skip to content

Request Body

Configure the request body for POST, PUT, and PATCH requests.

Body Types

JSON

The most common format for REST APIs:

json
{
  "username": "test",
  "email": "test@example.com"
}

Set Content-Type: application/json (added automatically when you select JSON).

Form Data

For form submissions:

username=test&password=secret

Set Content-Type: application/x-www-form-urlencoded.

XML

For SOAP or XML-based APIs:

xml
<?xml version="1.0"?>
<request>
  <action>ping</action>
</request>

Set Content-Type: text/xml or application/xml.

Raw Text

For plain text bodies:

Hello, World!

Set Content-Type: text/plain.

Variables in Body

Use variables to include dynamic values in your request body:

VariableDescriptionExample Output
Unix timestamp1706123456
ISO date2024-01-24
ISO datetime2024-01-24T15:30:00Z
Random UUID550e8400-e29b-41d4-a716-446655440000

Example:

json
{
  "requestId": "{{uuid}}",
  "timestamp": {{timestamp}},
  "action": "test"
}

Best Practices

Minimal Test Data

Use the smallest payload that exercises the endpoint:

json
{
  "email": "test@example.com"
}

Avoid Creating Real Data

When testing endpoints that create resources:

  • Use a test/sandbox environment
  • Include markers in test data: "name": "PINGWARD_TEST_USER"
  • Use endpoints that auto-cleanup test data

Sensitive Data

Never include real credentials or PII in test bodies. Use:

  • Test accounts with fake data
  • Sandbox environments
  • Token-based auth instead of password auth

Validation

Pingward validates JSON bodies before saving. If your JSON is invalid, you'll see an error message. Common issues:

  • Missing quotes around strings
  • Trailing commas
  • Unescaped special characters

Pingward - API Monitoring Made Simple