dio library

A dio adapter backed by nitro_http's native libcurl engine.

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

final dio = Dio()..useNitroHttp();
final res = await dio.get<Map<String, dynamic>>('https://example.com/api');

Import this library rather than package:nitro_http/nitro_http.dart — the main barrel stays free of dio, so an app that never imports this file tree-shakes the adapter away.

Classes

NitroHttpDioAdapter
Routes every dio request through a nh.NitroHttpClient.

Extensions

NitroHttpDio on Dio
Installs a NitroHttpDioAdapter on a Dio instance.

Constants

nitroHttpCacheModeKey → const String
The RequestOptions.extra key that selects a nh.CacheMode for one request.

Functions

dioExceptionTypeOf(NitroHttpException error) → DioExceptionType
The DioExceptionType that best describes error.