Skip to content

mkhtradm01/dio_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simplified implementation of Dio it targets developers that need to quickly have http implementation in their applications.

Features

This package has only four (4) methods for now, viz are:

  1. getRequest
  2. postRequest
  3. updateRequest
  4. deleteRequest

Getting started

Kindly initialize the DioClient object with your baseUrl and start accessing the methods.

Usage

///[baseUrl]
const baseUrl = 'https://jsonplaceholder.typicode.com';
///[Dioclient] object instantiation
final dioClient = DioClient(baseUrl: baseUrl);
try{
    ///calling of the methods
    final response = await dioClient.getRequest(path: '/posts');
    if(response.statusCode == 200){
        debugPrint(response.data);
    }else{
        debugPrint(response.statusMessage);
    }
}on Exception catch(e){
    debugPrint('Error: $e');
}

Additional information

More information can be found on Website Credits goes to Dio contributors as this package depends on it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published