Networking
Press Fetch to download a real JSON document over HTTPS. Cancel aborts the current request. The result shows the server's title, HTTP status, and UTF-8 byte count. Errors are displayed directly.
Networking globals are installed before the app runs: no imports are required for fetch, Request, Response, Headers, URL, URLSearchParams, AbortController, TextEncoder, or TextDecoder. The example aborts an old request before starting another and ignores stale completions. Its effect cancels a pending request on unmount.
The browser requires a CORS-enabled HTTPS endpoint. On firmware, connect Wi-Fi first; the same app source then uses the native networking implementation. The public test endpoint can be unavailable, in which case the example shows its error.
Other transports
WebSocket contains a complete connect, send, receive, and close example. TCP and UDP shows TCPSocket, TCPServer, and UDPSocket; those raw sockets require native firmware or the native simulator because browsers do not expose them. Wi-Fi covers scanning, connecting, status, and events on hardware. Browser networking uses the computer's existing connection; it cannot scan or reconfigure its Wi-Fi adapter.
The network API reference also covers EventTarget, Event, MessageEvent, CloseEvent, AbortSignal, DOMException, btoa, atob, and typed network errors. See API coverage for the complete map.