HTTP Sub-Requests

EdgeWorkers supports HTTP Requests made from within an event handler. These HTTP sub-requests provide a logical way to fetch resources asynchronously across the network.

You can use the onClientRequest, onClientResponse, and responseProvider event handlers to call the httpRequest() function. If you want your callback to wait for the subrequest to complete, the event handlers should return a Promise or be declared async.

To use sub-requests you need an associated delivery configuration. Hostnames can only be hit directly when served through the Akamai network. If you don't have an associated delivery product sub-requests will fail with a 400 HTTP response code.

See the Limitations section for more information about the supported delivery products and the event handlers timeouts.