What is Request Body?
The data payload sent with POST or PUT requests to provide input to the endpoint.
Definition
The request body is the main data payload included in HTTP requests, typically with POST, PUT, or PATCH methods. It contains the information the endpoint needs to process: JSON objects, form data, XML, or plain text. In CronJobPro, you can configure a static request body for each job, which is sent with every execution. Common use cases include passing parameters, filters, or configuration data to your endpoint.
Simple Analogy
Like the contents of a letter inside an envelope โ the envelope (headers) says who it is for and how to handle it, while the letter (body) contains the actual message.
Why It Matters
Many cron job endpoints need input data to know what to do. A report generation endpoint might need the report type and date range in the body. A data sync endpoint might need filter criteria. CronJobPro's ability to send a request body with each execution makes it a flexible integration tool, not just a simple URL pinger.
How to Verify
Test your endpoint with curl: `curl -X POST -H "Content-Type: application/json" -d '{"action": "sync"}' https://your-endpoint.com`. In CronJobPro, configure the body in the job settings and verify it appears correctly in execution logs.
Common Mistakes
Sending a body with GET requests (while technically possible, most servers ignore it). Mismatching the Content-Type header with the actual body format (declaring JSON but sending form data). Including sensitive data in the body without HTTPS encryption.
Best Practices
Use JSON format for request bodies with the "application/json" Content-Type header. Validate the body format on your endpoint and return descriptive errors for malformed input. Never include secrets directly in the body โ use authentication headers instead. Keep the body minimal and relevant.
HTTP Methods Guide
Learn about HTTP methods
Try it free โFrequently Asked Questions
What is Request Body?
The request body is the main data payload included in HTTP requests, typically with POST, PUT, or PATCH methods. It contains the information the endpoint needs to process: JSON objects, form data, XML, or plain text. In CronJobPro, you can configure a static request body for each job, which is sent with every execution. Common use cases include passing parameters, filters, or configuration data to your endpoint.
Why does Request Body matter for cron jobs?
Many cron job endpoints need input data to know what to do. A report generation endpoint might need the report type and date range in the body. A data sync endpoint might need filter criteria. CronJobPro's ability to send a request body with each execution makes it a flexible integration tool, not just a simple URL pinger.
What are best practices for Request Body?
Use JSON format for request bodies with the "application/json" Content-Type header. Validate the body format on your endpoint and return descriptive errors for malformed input. Never include secrets directly in the body โ use authentication headers instead. Keep the body minimal and relevant.
Related Terms
Content-Type
An HTTP header that specifies the format of the request or response body (e.g., JSON, XML, form data).
Request Header
Key-value metadata sent with an HTTP request to provide context like authentication and content type.
HTTP Method
The verb (GET, POST, PUT, DELETE, etc.) that defines the type of action an HTTP request performs.
Response Body
The data payload returned by a server after processing an HTTP request.