Repository navigation
deno integration
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 OKstems from fhttp's normal output, which gets mixed with theprinterrlogs. You'll want to useprinterrfor debugging only.