Last updated:
0 purchases
apsl api call
APSL API Call Package #
A Dart package designed to simplify the process of making API calls and handling exceptions.
Table of Contents #
Features
Installation
Usage
Making an API Call
Handling Exceptions
Classes & Methods
Contributing
License
Features #
API Calls: Provides methods for making both regular and multipart API calls.
Exception Handling: Handles common exceptions such as no internet, server errors, timeouts, and more.
Connectivity Checks: Automatically checks for internet connectivity before making an API call.
Predefined Error Messages: Includes a collection of predefined error messages for various API call scenarios.
Installation #
To use the apsl_api_call package, add it as a dependency in your pubspec.yaml file:
dependencies:
apsl_api_call: ^1.0.0
copied to clipboard
Example #
Making an API Call
import 'package:apsl_api_call/apsl_api_call.dart';
// Define your API request information
APIRequestInfoObj requestInfo = APIRequestInfoObj(
requestType: HTTPRequestType.get,
url: "https://api.example.com/data",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
},
serviceName: "GetData"
);
// Make the API call
http.Response response = await ApiCall.callService(requestInfo: requestInfo);
copied to clipboard
Contributing #
Contributions are welcome! Please read our contributing guidelines to get started.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.