Options
headers
Extra request headers sent with every request of the page, up to 50.
- Type
- object
- Default
- None
- Also accepted as
- extraHTTPHeaders
- Group
- Request and identity
On this page
OverviewLink to this section
Extra HTTP headers sent with every request the page makes: the page itself and every script, style, image and call it loads. Use them for preview tokens, feature flags or anything else the site reads from a header.
Pass an object of header names and values. Up to 50 headers are used. Names must be valid header names, values must be strings or numbers, and a value with a line break is dropped.
ExampleLink to this section
The same request with the SDK, with cURL and as the raw JSON body.
screenshot.ts
import { Url2Image } from '@url2image/sdk'
const { success, data, message } = await Url2Image({
url: 'https://example.com',
token: process.env.URL2IMAGE_TOKEN,
options: {
headers: {
'X-Preview-Token': 'YOUR_PREVIEW_TOKEN'
}
}
})Good to knowLink to this section
Related optionsLink to this section
refererThe referer sent with the page request.localeThe language and region the page sees, such as en-US or de-DE.
Every option, grouped, is in the options overview.
Something unclear or missing on this page?
Tell us