Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

OCP App SDK / Headers

Headers

Index

Constructors

Methods

Constructors

constructor()

Signature

new Headers(headers: string[][] = []): Headers;

Parameters

NameTypeDefault value
headersstring[][][]

Returns

Headers

Defined in: src/app/lib/Headers.ts:4

Methods

add()

Signature

add(name: string, value: string): void;

Parameters

NameType
namestring
valuestring

Returns

void

Defined in: src/app/lib/Headers.ts:16

addFromArray()

Signature

addFromArray(headers: string[][]): void;

Parameters

NameType
headersstring[][]

Returns

void

Defined in: src/app/lib/Headers.ts:42

get()

Signature

get(name: string): undefined | string;

Parameters

NameType
namestring

Returns

undefined | string

Defined in: src/app/lib/Headers.ts:8

has()

Signature

has(name: string): boolean;

Parameters

NameType
namestring

Returns

boolean

Defined in: src/app/lib/Headers.ts:12

set()

Signature

set(name: string, value: null | string): void;

Parameters

NameType
namestring
valuenull | string

Returns

void

Defined in: src/app/lib/Headers.ts:29

setFromObject()

Signature

setFromObject(headers: object): void;

Parameters

NameType
headers{}

Returns

void

Defined in: src/app/lib/Headers.ts:46

toArray()

Signature

toArray(): string[][];

Returns

string[][]

Defined in: src/app/lib/Headers.ts:38