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

Package for making HTTP requests used by unofficial_twitch packages

Client package for twitch unofficial app.

Available on pub.dev: https://pub.dev/packages/unofficial_twitch_http

Features #

This package allow to make request using the http's dart package.

For more information see the class twitch_http_client.dart

Getting started #

The main class TwitchHttpClient has a concrete implementation TwitchHttpClientImpl. In order to work, it needs the environment bundle, where we have to specify the basePath:

final client = TwitchHttpClientImpl(
  environmentBundle: EnvironmentBundle(
    basePath: TwitchOpenApiConstants.baseUrl,
  ),
);

Then we can make a simple request like:

final response = await client.makeGet(
  "/success",
  convertBodyFunc: (response) {
    return MockResult.fromResponse(response);
  },
);

All the response are wrapped into the HttpResult, which contains a response or eventually an error

Additional information #

If you want a real example, see the main app

2
likes
110
pub points
34%
popularity

Publisher

verified publisherfedericoviceconti.com

Package for making HTTP requests used by unofficial_twitch packages

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, http

More

Packages that depend on unofficial_twitch_http