persist_http

Last updated:

0 purchases

persist_http Image
persist_http Images
Add to Cart

Description:

persist http

persist_http #




This library provides an efficient way to handle HTTP requests by reusing the same HTTP handshake. It's designed for Dart environments and supports all platforms except Flutter Web due to the use of dart:io.
Installation #
dependencies:
persist_http: ^0.0.1-beta
copied to clipboard
Example #
import 'package:flutter/foundation.dart';
import 'package:persist_http/persist_http.dart';

void main() async {
await connectionsCheck();
await multiCallWithPersistConnection();
}

Future<void> connectionsCheck() async {
var client = PresistHttp("example.com");
await client.connect();
await client.close();
}

Future<void> multiCallWithPersistConnection() async {
final persistHttp = PresistHttp('randomuser.me');
await persistHttp.connect();

for (var i = 0; i < 10; i++) {
final response = await persistHttp.get('/api');
debugPrint(response);
}

await persistHttp.close();
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.