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
Bearer Token
An access token sent in the Authorization header to authenticate HTTP requests.
Content-Type
An HTTP header that specifies the format of the request or response body (e.g., JSON, XML, form data).
User-Agent
An HTTP header identifying the client software making the request.
Basic Authentication
An HTTP authentication scheme that sends a Base64-encoded username and password with each request.