Skip to content

@tauri-apps/plugin-http

Make HTTP requests with the Rust backend.

This API has a scope configuration that forces you to restrict the URLs that can be accessed using glob patterns.

For instance, this scope configuration only allows making HTTP requests to all subdomains for tauri.app except for https://private.tauri.app:

{
"permissions": [
{
"identifier": "http:default",
"allow": [{ "url": "https://*.tauri.app" }],
"deny": [{ "url": "https://private.tauri.app" }]
}
]
}

Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access.

Defined in: plugins/http/guest-js/index.ts:75

Options to configure the Rust client used to make fetch requests

2.0.0

Property Type Description Defined in
connectTimeout? number Timeout in milliseconds plugins/http/guest-js/index.ts:82
danger? DangerousSettings Configuration for dangerous settings on the client such as disabling SSL verification. plugins/http/guest-js/index.ts:90
maxRedirections? number Defines the maximum number of redirects the client should follow. If set to 0, no redirects will be followed. plugins/http/guest-js/index.ts:80
proxy? Proxy Configuration of a proxy that a Client should pass requests to. plugins/http/guest-js/index.ts:86

Defined in: plugins/http/guest-js/index.ts:98

Configuration for dangerous settings on the client such as disabling SSL verification.

2.3.0

Property Type Description Defined in
acceptInvalidCerts? boolean Disables SSL verification. plugins/http/guest-js/index.ts:102
acceptInvalidHostnames? boolean Disables hostname verification. plugins/http/guest-js/index.ts:106

Defined in: plugins/http/guest-js/index.ts:36

Configuration of a proxy that a Client should pass requests to.

2.0.0

Property Type Description Defined in
all? string | ProxyConfig Proxy all traffic to the passed URL. plugins/http/guest-js/index.ts:40
http? string | ProxyConfig Proxy all HTTP traffic to the passed URL. plugins/http/guest-js/index.ts:44
https? string | ProxyConfig Proxy all HTTPS traffic to the passed URL. plugins/http/guest-js/index.ts:48

Defined in: plugins/http/guest-js/index.ts:51

Property Type Description Defined in
basicAuth? object Set the Proxy-Authorization header using Basic auth. plugins/http/guest-js/index.ts:59
basicAuth.password string - plugins/http/guest-js/index.ts:61
basicAuth.username string - plugins/http/guest-js/index.ts:60
noProxy? string A configuration for filtering out requests that shouldn’t be proxied. Entries are expected to be comma-separated (whitespace between entries is ignored) plugins/http/guest-js/index.ts:67
url string The URL of the proxy server. plugins/http/guest-js/index.ts:55

function fetch(input, init?): Promise<Response>;

Defined in: plugins/http/guest-js/index.ts:125

Fetch a resource from the network. It returns a Promise that resolves to the Response to that Request, whether it is successful or not.

Parameter Type
input | string | URL | Request
init? RequestInit & ClientOptions

Promise<Response>

const response = await fetch("http://my.json.host/data.json");
console.log(response.status); // e.g. 200
console.log(response.statusText); // e.g. "OK"
const jsonData = await response.json();

2.0.0


© 2026 Tauri Contributors. CC-BY / MIT