🥷 Try it live — no local setup. ICP Ninja is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit Deploy if you're already in Ninja. To build and run it locally instead, follow the steps below.
This example demonstrates how to use the Internet Computer's HTTPS outcalls feature to make a GET request from a Rust canister. It sends a request to postman-echo.com and returns the echoed JSON response, showing how to pass query parameters and headers through HTTP outcalls.
For a deeper understanding of HTTPS outcalls on the IC, see the HTTPS outcalls documentation.
- Node.js v18+
- icp-cli:
npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm - Rust with
wasm32-unknown-unknowntarget:rustup target add wasm32-unknown-unknown
git clone https://github.com/dfinity/examples
cd examples/rust/send_http_geticp network start -d
icp deploy
bash test.sh
icp network stopRefer to the security best practices for information on security and best practices for your ICP app.