chopper 0.0.2 copy "chopper: ^0.0.2" to clipboard
chopper: ^0.0.2 copied to clipboard

outdatedDart 1 only

Chopper is an http client generator using source_gen and inspired from retrofit

example/main.dart

import 'package:chopper/chopper.dart';
import 'definition.dart';

main() async {
  final chopper = new ChopperClient(
      baseUrl: "http://localhost:8000",
      converter: const JsonConverter(),
      apis: [
        // the generated service
        new MyService()
      ],
      /* ResponseInterceptorFunc | RequestInterceptorFunc | ResponseInterceptor | RequestInterceptor */
      interceptors: [
        new Headers(const {"Content-Type": "application/json"}),
      ]);

  final myService = chopper.service(MyService) as MyService;

  final response = await myService.getMapResource("1");
  print(response.body);
}
756
likes
0
pub points
98%
popularity

Publisher

verified publisherhadrienlejard.io

Chopper is an http client generator using source_gen and inspired from retrofit

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http, meta

More

Packages that depend on chopper