tauri开发软件时报错The `Http` module is not enabled. You must enable one of its APIs in the allowlist.

1,069 阅读1分钟

[Error] The `Http` module is not enabled. You must enable one of its APIs in the allowlist.
    (anonymous function) (http.ts:38)
[Error] Unhandled Promise Rejection: The `Http` module is not enabled. You must enable one of its APIs in the allowlist.

这是因为你没有开启tauri的网络请求权限,看官方文档:http | Tauri Apps

在src-tauri/tauri.conf.json中开启:

"http": {
                "all": true,
                "scope": ["https://*"]
            },

再次发送请求就好了: