new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Tauri · Plugins and security · all subjects

http plugin

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

HTTP client breaking change in 2.0.0-alpha.4

The default HTTP client using `attohttpc` has been removed due to issues with the development server proxy on Windows. All `reqwest-*` feature flags have been removed because `reqwest` is now the client used.

HTTP plugin migration: Cargo dependency

To migrate HTTP functionality to Tauri 2.0 plugin, add to Cargo.toml: [dependencies] tauri-plugin-http = "2"

HTTP plugin migration: Rust setup

In Tauri 2.0, set up HTTP plugin in Rust with: tauri::Builder::default().plugin(tauri_plugin_http::init())

HTTP plugin migration: JavaScript usage

In Tauri 2.0 JavaScript, use HTTP plugin: import { fetch } from '@tauri-apps/plugin-http'; const response = await fetch('https://raw.githubusercontent.com/tauri-apps/tauri/dev/package.json');

HTTP plugin migration: Rust usage

In Tauri 2.0 Rust, use HTTP plugin with: use tauri_plugin_http::reqwest; tauri::Builder::default().plugin(tauri_plugin_http::init()).setup(|app| { let response_data = tauri::async_runtime::block_on(async { reqwest::get("https://...").await.unwrap().text().await })?; Ok(()) })

HTTP plugin re-exports reqwest

The Tauri 2.0 HTTP plugin re-exports reqwest crate for use in Rust backend code.

Give your agent this brain