Siesta: A Swift HTTP networking library
Siesta is an innovative Swift library designed to simplify HTTP networking. The library handles model synchronization, caching, request throttling, and user interface updates automatically, so you can focus on the stuff that matters.
Features
- Automatic caching and model synchronization
- Request throttling and deduplication
- UI components update on the fly
- Supports both REST and GraphQL
- Easy and flexible configuration
- No external dependencies
Installation
Siesta can be installed through Swift Package Manager, CocoaPods, or Carthage. Detailed installation instructions can be found in the Siesta GitHub repository.
Usage
Prior to using Siesta, you need to import the Siesta module. In networking with Siesta, concepts like ‘Resources’, ‘Requests’, and ‘Services’ are crucial, as they form the three pillars of the framework.
Services
‘Services’ handle configuration that is shared across several resources. This includes things like base URLs, common headers, networking setup, request methods, and more.
Resources
‘Resources’ represent a URL from which the app can retrieve stateful data. Siesta heavily relies on this concept, as it ensures that at any given time, only one instance of a specific resource exists throughout your app.
Requests
A ‘Request’ in Siesta represents an action that changes a resource. This could be a POST, PUT, DELETE, or any other HTTP method that modifies the state of a resource.
Documentation
For more detailed documentation, please visit the official Siesta GitHub repository. It contains extensive usage examples, a complete API reference, as well as troubleshooting guides.
Contributions
Contributions to Siesta are always welcome. Potential contributors are advised to check out the Contribution Guidelines from the Siesta GitHub repository to get started.
Licence
Siesta is licensed under the MIT License. This permits use, copy, modification, merge, publish, distribute, sublicensing, and selling provided the original licensing is included in all copies or substantial portions of the Software.