Tested with Dart SDK v3.5.2,
package:requests
v5.0.0,
Chrome browser v133.0, and Firefox browser v135.0.
- Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.
cd
into the folder of this example:
cd browser-package-requests
- It appears the latest dart-requests' version 5.0.0 is not published on pub.dev, wherefore this library is installed from Github repo directly. Ensure all dependencies are installed:
dart pub get
cd
into theweb
subfolder, where sources are located:
cd web
- Compile the example:
dart compile wasm main.dart
- Run simple HTTP server to temporarily publish project to Web:
python3 -m http.server
Codespace will show you "Open in Browser" button. Just click that button or obtain web address from "Forwarded Ports" tab.
- As
index.html
and a 193k-sized wasm file are loaded into browser, refer to browser developer console to see the results.
Perform your own experiments if desired.