Search packages, repositories and app categories

Package detailsv0.3.1

sync_http

Synchronous HTTP client for Dart.

AndroidiOSmacOSWindowsLinux
30-day downloads
9.6M
Likes
16
Pub points
120

Install package

flutter pub add sync_http

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

sync_http is a synchronous HTTP client for Dart, designed to simplify making HTTP requests in environments where asynchronous operations are not ideal. It provides a straightforward API for performing GET, POST, PUT, and other HTTP methods synchronously, blocking execution until the response is received. This makes it suitable for use cases requiring simple, linear control flow, such as CLI tools or scripts. The package is maintained by Google and supports multiple platforms including Android, iOS, macOS, Windows, and Linux.

Use cases

  • Command-line tools
  • Scripting workflows
  • Simple data fetching
  • Synchronous backend processing
  • Testing HTTP interactions

Key features

  • Synchronous request handling
  • Simple and intuitive API
  • Cross-platform support
  • Lightweight and minimal
  • Built-in error handling

Suitable for

  • Developers needing blocking HTTP calls
  • Non-UI applications
  • Prototyping and testing
  • Legacy code integration
  • Simple automation scripts

Considerations

  • Not suitable for UI threads due to blocking nature
  • Limited scalability compared to async alternatives
  • May cause performance issues in high-throughput scenarios
  • Best used in non-interactive contexts only

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Dart CI pub package package publisher

A Dart HTTP client implemented using RawSynchronousSockets to allow for synchronous HTTP requests.

Using this package

Note: this package is only intended for very specialized use cases. For general HTTP usage, please see instead package:http.

This library should probably only be used to connect to HTTP servers that are hosted on 'localhost'. The operations in this library will block the calling thread to wait for a response from the HTTP server. The thread can process no other events while waiting for the server to respond. As such, this synchronous HTTP client library is not suitable for applications that require high performance. Instead, such applications should use libraries built on asynchronous I/O, including dart:io and package:http, for the best performance.

Categories

Source repository

Projects using this package