Custom headers
Place target headers in a headers context entry and enable force_headers. These values belong to the target request. API authentication stays on your outer request to Crawlhub.
Header context
{
"source": "universal",
"url": "https://example.com/",
"context": [
{
"key": "force_headers",
"value": true
},
{
"key": "headers",
"value": {
"Accept-Language": "en-US,en;q=0.8"
}
}
]
}POST to a target
The universal source uses GET by default. To POST to the target, set http_method to post and pass the Base64-encoded body in content. Both are context entries. The API submission itself is still a POST JSON request.
Target POST with hello=world
{
"source": "universal",
"url": "https://httpbin.org/post",
"context": [
{
"key": "http_method",
"value": "post"
},
{
"key": "content",
"value": "aGVsbG89d29ybGQ="
}
]
}Redirects and accepted status
The follow_redirects context switch controls redirect following; the default follows up to 10 redirects as one job. Use successful_status_codes only when a nonstandard target status is an intentional collection result.