Skip to content

Options

headers

Extra request headers sent with every request of the page, up to 50.

Type
object
Default
None
Also accepted as
extraHTTPHeaders
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

Every option, grouped, is in the options overview.

Something unclear or missing on this page?

Tell us
Made with Modulify