cordova-plugin-fetch
v0.0.1
Published
The cordova-plugin-fetch plugin addresses CORS (Cross-Origin Resource Sharing) issues encountered when using the Fetch API in JavaScript.
Readme
cordova-plugin-fetch
Description
The cordova-plugin-fetch plugin addresses CORS (Cross-Origin Resource Sharing) issues encountered when using the Fetch API in JavaScript. By integrating this plugin, developers can make HTTP requests to external resources without being blocked by CORS restrictions.
Features
- Interoperability: Utilizes native Java fetch to handle requests, ensuring optimal compatibility with mobile platforms.
- Ease of Use: Simply replace your JavaScript
fetchcalls with_fetch(), without requiring complex modifications to your existing code. - Real-time Results: Returns the results of requests directly to your JavaScript code, making it easier to process responses.
Installation
To install the plugin, use the following command:
cordova plugin add cordova-plugin-fetchUsage
Here’s an example of how to use the plugin:
_fetch('https://httpbin.org/get')
.then(response => response.json())
.then(console.log)
.catch(console.error)Contribution
Contributions are welcome! Feel free to submit issues or feature requests.
License
This project is licensed under the GPL-3.0-or-later license.
