node_http 1.0.1
node_http: ^1.0.1 copied to clipboard

HTTP client powered by Node.js I/O system.

node_http #

HTTP client using Node I/O system for Dart.

Usage #

A simple usage example:

import 'package:node_http/node_http.dart' as http;

main() async {
  // For one-off requests.
  final response1 = await http.get(''); 
  // To re-use socket connections:
  final client = new http.NodeClient();
  final response2 = await client.get('');

Configuration and build #

Add build_node_compilers and build_runner to dev_dependencies section in pubspec.yaml of your project:

  build_runner: # needed to run the build

Add build.yaml file to the root of your project:

      - "node/**"
      - "test/**" # Include this if you want to compile tests.
      - "example/**" # Include this if you want to compile examples.

By convention all Dart files which declare main function go in node/ folder.

To build your project run following:

pub run build_runner build --output=build/

Features and bugs #

Please file feature requests and bugs at the issue tracker.