Web Platform APIs
Here is a list of web platform APIs Deno implements:
The fetch
API can be used to make HTTP requests. It is implemented as specified in the WHATWG fetch
spec.
Spec deviations
- The Deno user agent does not have a cookie jar. As such, the
set-cookie
header on a response is not processed, or filtered from the visible response headers. - Deno does not follow the same-origin policy, because the Deno user agent currently does not have the concept of origins, and it does not have a cookie jar. This means Deno does not need to protect against leaking authenticated data cross origin. Because of this Deno does not implement the following sections of the WHATWG specification:
- Section
3.1. 'Origin' header
. - Section
3.2. CORS protocol
. - Section
3.5. CORB
. - Section
3.6. 'Cross-Origin-Resource-Policy' header
. Atomic HTTP redirect handling
.- The
opaqueredirect
response type.
- Section
- A
fetch
with aredirect
mode of will return abasic
response rather than anopaqueredirect
response.
The DOM Event API can be used to dispatch and listen to events happening in an application. It is implemented as specified in the WHATWG DOM spec.
You can find documentation about this API on .
Spec deviations
- Events do not bubble, because Deno does not have a DOM hierarchy, so there is no tree for Events to bubble/capture through.
You can find documentation about this API on .
Spec deviations
- Currently posted data is serialized to JSON instead of structured cloning.
- Currently object ownership cannot be transferred between workers.
The TypeScript definitions for the implemented web APIs can be found in the and lib.deno.window.d.ts
files.