libasserest_http 1.0.0 copy "libasserest_http: ^1.0.0" to clipboard
libasserest_http: ^1.0.0 copied to clipboard

HTTP(S) assertion library for Asserest platform for IO and web platform.

example/main.dart

import 'package:libasserest_interface/interface.dart';
import 'package:libasserest_http/http.dart';
import 'package:libasserest_http/initializer.dart';

void main() {
  asserestHttpSetup();

  final List<AsserestHttpProperty> httpProp = [
    AsserestHttpProperty(Uri.https("www.example.com"), true,
        Duration(seconds: 30), 5, HttpRequestMethod.GET, null, null),
    AsserestHttpProperty(Uri.https("www.foo.com"), false, Duration(seconds: 30),
        null, HttpRequestMethod.POST, null, "Sample text")
  ];

  final executor = httpProp.assignAndBuildExecutor(
      name: "Sample HTTP assertion", threads: 2);

  void shutdownExecutor() async {
    executor.shutdown();
  }

  executor.invoke().listen((report) {
    print(report.actual);
  })
    ..onDone(shutdownExecutor)
    // ignore: argument_type_not_assignable_to_error_handler
    ..onError(shutdownExecutor);
}
0
likes
150
points
21
downloads

Publisher

verified publisherrk0cc.xyz

Weekly Downloads

HTTP(S) assertion library for Asserest platform for IO and web platform.

Repository (GitHub)

Documentation

API reference

License

AGPL-3.0 (license)

Dependencies

async_task, http, libasserest_interface, meta

More

Packages that depend on libasserest_http