rest_api_package 1.0.0+1 copy "rest_api_package: ^1.0.0+1" to clipboard
rest_api_package: ^1.0.0+1 copied to clipboard

Do you want an easy way to handle requests without repeating yourself? rest-api-package offers you that! An easy way to handle Rest-API requests

example/main.dart

import 'dart:developer';

import 'package:dio/dio.dart';
import 'package:rest_api_package/rest_api_package.dart';

import 'models/cat_fact_model.dart';

void main() async {
  final restApiHttpService = RestApiHttpService(
    Dio(),
    'https://cat-fact.herokuapp.com/',
  );

  final catFactsRequest = RestApiRequest(
    endPoint: 'facts',
    requestMethod: RequestMethod.GET,
    useNewDioInstance: true,
  );

  final catFactList = await restApiHttpService.requestAndHandleList(
    catFactsRequest,
    parseModel: CatFact.fromJson,
  );

  log('Result: $catFactList');
}
4
likes
130
points
2
downloads

Publisher

verified publisheralgoritechnology.com

Weekly Downloads

Do you want an easy way to handle requests without repeating yourself? rest-api-package offers you that! An easy way to handle Rest-API requests

Repository (GitHub)
View/report issues

Topics

#network #http

Documentation

API reference

License

unknown (license)

Dependencies

cookie_jar, dio, dio_cookie_manager, flutter, http_parser

More

Packages that depend on rest_api_package