Event handlers support matrix

View the EdgeWorkers JavaScript objects, attributes, and functions each event type supports.

See Event handler functions for more information about the supported event types.
Note: The onClientRequest, onOriginRequest, onOriginResponse, and onClientResponse event handlers support the GET, HEAD, POST, PUT, and DELETE HTTP methods. The responseProvider event handler currently only supports the GET and HEAD HTTP methods.
Event Handler Use Cases Methods
onClientRequest

Redirect Management

Traffic Filtering

Allow / Deny

Static Response Offload

respondWith(status,headers,body,[deny_reason])
Header Management

getHeader(name, value)

setHeader(name, value)

addHeader(name,value)

removeHeader(name)

Cookie Management

Cookies([cookieHeader], [options])

toHeader([options])

get(name)

getAll (name)

names()

add(name, value)

delete(name)

Note: To use these Cookie Management methods, you need to import the Cookies module.
Delivery Property Flow Control

getVariable(name)

setVariable(name, value)

Conditionally Route Traffic

Personalization

route(destination)
Cache Key Manipulation

excludeQueryString()

includeQueryString()

includeQueryArgument(name)

includeCookie(name)

includeHeader(name)

includeVariable(name)

onOriginRequest Header Management

getHeader(name, value)

setHeader(name, value)

addHeader(name,value)

removeHeader(name)

Cookie Management

Cookies([cookieHeader], [options])

toHeader([options])

get(name)

getAll (name)

names()

add(name, value)

delete(name)

Note: To use these Cookie Management methods, you need to import the Cookies module.
Delivery Property Flow Control

getVariable(name)

setVariable(name, value)

onOriginResponse Header Management

getHeader(name, value)

setHeader(name, value)

addHeader(name,value)

removeHeader(name)

Cookie Management

Cookies([cookieHeader], [options])

toHeader([options])

get(name)

getAll (name)

names()

add(name, value)

delete(name)

Note: To use these Cookie Management methods, you need to import the Cookies module.
Delivery Property Flow Control

getVariable(name)

setVariable(name, value)

onClientResponse Header Management

getHeader(name, value)

setHeader(name, value)

addHeader(name,value)

removeHeader(name)

Cookie Management

Cookies([cookieHeader], [options])

toHeader([options])

get(name)

getAll (name)

names()

add(name, value)

delete(name)

Note: To use these Cookie Management methods, you need to import the Cookie module.
Delivery Property Flow Control

getVariable(name)

setVariable(name, value)

responseProvider Response Orchestration

httpRequest()

text()

json()

getHeader(name)

getHeaders()

createResponse()

Note: To use these responseProvider functions, you need to import the create-response, streams, text-encode-transform, and http-request modules.
Manipulate the response (body, headers)

createResponse()