Skip to content

deno integration

Choose a tag to compare

@github-actions github-actions released this 06 Aug 06:43

This release adds the long-planned and long-awaited response handler deno, which allows you to leverage the versatility of javascript to process the response to your request. Additionally, this enables you to not just process the response body but also the status code and the headers.

note that response handlers are only called for status codes 200 through 299.

Example:

GET http://someurl

> {%
    deno
    printerr(JSON.stringify(headers));
    printerr(`the status was ${status}`);
    setResult(42);
%}

will print something like

GET http://someurl... {"content-type": "application/json"}
the status was 200
200 OK
42

the 200 OK stems from fhttp's normal output, which gets mixed with the printerr logs. You'll want to use print and printerr for debugging only.