Skip to content
pubscout

http

1.6.0, released a year ago by dart.dev

A composable, Future‑based library for making HTTP requests across platforms.

WASM-readyRock solidQuiet but busy
$ flutter pub add http
Source repository

What it does

Provides high‑level functions and client classes to perform HTTP GET, POST, and other requests. Supports persistent connections, request retry, and aborting on web, mobile, and desktop.

AI-written summary of version 1.6.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Simple REST calls without heavy abstraction
  • Need cross‑platform support (mobile, web, desktop)
  • Want easy testability with mock clients

Skip it when

  • Require built‑in authentication or OAuth flows
  • Need GraphQL or gRPC client features
  • Prefer code‑generated API clients

Strengths

  • Multi‑platform (mobile, web, desktop)
  • Simple, Future‑based API
  • Easy to mock for testing
  • Retry and abort capabilities

Weaknesses

  • No built‑in JSON serialization or auth helpers
  • Limited to low‑level HTTP, no higher‑level abstractions
  • No code generation

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

May require additional Android/iOS network configuration (e.g., cleartext traffic settings).

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

void main() async {
  var url = Uri.https('example.com', 'path');
  var response = await http.get(url);
  print('Status: ${response.statusCode}');
  print('Body: ${response.body}');
}

Alternatives

Packages that do the same job and could replace http.

  • dio

    Offers richer features like interceptors, FormData, and built‑in cancellation.

Works with

Packages commonly used together with http: ones it builds on, ones built on it, and its own family.