Makes it easy to use Axios in Tauri App
npm install axios-tauri-api-adapter
import axios from 'axios';
import axiosTauriApiAdapter from 'axios-tauri-api-adapter';
const client = axios.create({ adapter: axiosTauriApiAdapter });
Add the following configuration to the tauri.config.json
See Details
{
"tauri": {
"allowlist": {
"http": {
"all": true, // Use this flag to enable all HTTP API features.
"request": true, // Allows making HTTP requests.
"scope": ["https://example.com/*"] // access scope for the HTTP APIs.
}
}
}
}
- HTTP Requests use
@tauri-apps/api/http
instead ofXHR(XMLHttpRequest)
- Add
config.jwt
It's going to add JWT to the header
MIT License
The project has always been developed in the Idea integrated development environment under JetBrains, based on the free JetBrains Open Source license(s) genuine free license, I would like to express my gratitude here