HTTP & Webhooksintermediate

What is Request Header?

Key-value metadata sent with an HTTP request to provide context like authentication and content type.

Definition

Request headers are key-value pairs sent at the beginning of an HTTP request that provide metadata about the request. Common headers include Authorization (authentication credentials), Content-Type (format of the request body), User-Agent (client identifier), and Accept (desired response format). In CronJobPro, you can configure custom headers per job to authenticate with your endpoint or pass additional context.

๐Ÿ’ก

Simple Analogy

Like the label on a shipping package โ€” it tells the recipient who sent it, what is inside, and how to handle it, all before the package is opened.

Why It Matters

Many endpoints require specific headers to function correctly. Without the right Authorization header, your job gets a 401 error. Without the correct Content-Type, the server may misinterpret your request body. CronJobPro lets you set custom headers per job, which is essential for integrating with authenticated APIs.

How to Verify

Review your endpoint's documentation for required headers. Test with curl: `curl -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" https://your-endpoint.com`. In CronJobPro, check the job's header configuration and verify in execution logs that headers were sent correctly.

โš ๏ธ

Common Mistakes

Forgetting to set Content-Type when sending JSON bodies (the server may reject the request). Including sensitive tokens in headers without using HTTPS (they are visible in transit). Not updating headers when API keys are rotated, causing authentication failures.

โœ…

Best Practices

Always use HTTPS when sending authentication headers. Store sensitive header values (API keys, tokens) securely using CronJobPro's secret management. Set appropriate Content-Type headers for your request body format. Include a User-Agent header to identify CronJobPro requests in your server logs.

HTTP Methods Guide

Learn about HTTP methods

Try it free โ†’

Frequently Asked Questions

What is Request Header?

Request headers are key-value pairs sent at the beginning of an HTTP request that provide metadata about the request. Common headers include Authorization (authentication credentials), Content-Type (format of the request body), User-Agent (client identifier), and Accept (desired response format). In CronJobPro, you can configure custom headers per job to authenticate with your endpoint or pass additional context.

Why does Request Header matter for cron jobs?

Many endpoints require specific headers to function correctly. Without the right Authorization header, your job gets a 401 error. Without the correct Content-Type, the server may misinterpret your request body. CronJobPro lets you set custom headers per job, which is essential for integrating with authenticated APIs.

What are best practices for Request Header?

Always use HTTPS when sending authentication headers. Store sensitive header values (API keys, tokens) securely using CronJobPro's secret management. Set appropriate Content-Type headers for your request body format. Include a User-Agent header to identify CronJobPro requests in your server logs.

Related Terms