http_parser 3.1.3

http_parser is a platform-independent package for parsing and serializing various HTTP-related formats. It's designed to be usable on both the browser and the server, and thus avoids referencing any types from dart:io or dart:html. It includes:

  • Support for parsing and formatting dates according to HTTP/1.1, the HTTP/1.1 standard.

  • A MediaType class that represents an HTTP media type, as used in Accept and Content-Type headers. This class supports both parsing and formatting media types according to HTTP/1.1.

  • A WebSocketChannel class that provides a StreamChannel interface for both the client and server sides of the WebSocket protocol independently of any specific server implementation.

3.1.3 #

  • Set max SDK version to <3.0.0, and adjust other dependencies.

3.1.2 #

  • Require Dart SDK 2.0.0-dev.17.0 or greater.

  • A number of strong-mode fixes.

3.1.1 #

  • Fix a logic bug in the chunkedCoding codec. It had been producing invalid output and rejecting valid input.

3.1.0 #

3.0.2 #

  • Support string_scanner 1.0.0.

3.0.1 #

  • Remove unnecessary dependencies.

3.0.0 #

  • All deprecated APIs have been removed. No new APIs have been added. Packages that would use 3.0.0 as a lower bound should use 2.2.0 instead—for example, http_parser: ">=2.2.0 <4.0.0".

  • Fix all strong-mode warnings.

2.2.1 #

  • Add support for crypto 1.0.0.

2.2.0 #

2.1.0 #

  • Added WebSocketChannel, an implementation of StreamChannel that's backed by a WebSocket.

  • Deprecated CompatibleWebSocket in favor of WebSocketChannel.

2.0.0 #

  • Removed the DataUri class. It's redundant with the getter that's coming in Dart 1.14, and the field in particular was an invalid override of that field.

1.1.0 #

  • The MIME spec says that media types and their parameter names are case-insensitive. Accordingly, MediaType now uses a case-insensitive map for its parameters and its type and subtype fields are now always lowercase.

1.0.0 #

This is 1.0.0 because the API is stable—there are no breaking changes.

  • Added an AuthenticationChallenge class for parsing and representing the value of WWW-Authenticate and related headers.

  • Added a CaseInsensitiveMap class for representing case-insensitive HTTP values.

0.0.2+8 #

  • Bring in the latest dart:io WebSocket code.

0.0.2+7 #

  • Add more detail to the readme.

0.0.2+6 #

  • Updated homepage URL.

0.0.2+5 #

  • Widen the version constraint on the collection package.

0.0.2+4 #

  • Widen the string_scanner version constraint.

0.0.2+3 #

  • Fix a library name conflict.

0.0.2+2 #

  • Fixes for HTTP date formatting.

0.0.2+1 #

  • Minor code refactoring.

0.0.2 #

  • Added CompatibleWebSocket, for platform- and API-independent support for the WebSocket API.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  http_parser: ^3.1.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:http_parser/http_parser.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 13, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/src/chunked_coding/decoder.dart. (-8.63 points)

Analysis of lib/src/chunked_coding/decoder.dart reported 18 hints, including:

line 13 col 30: Avoid const keyword.

line 20 col 16: Unnecessary new keyword.

line 24 col 11: Unnecessary new keyword.

line 28 col 7: Unnecessary new keyword.

line 60 col 13: Unnecessary new keyword.

Fix lib/src/media_type.dart. (-5.84 points)

Analysis of lib/src/media_type.dart reported 12 hints, including:

line 14 col 22: Unnecessary new keyword.

line 47 col 21: Unnecessary new keyword.

line 75 col 14: Unnecessary new keyword.

line 82 col 22: Unnecessary new keyword.

line 83 col 39: Unnecessary new keyword.

Fix lib/src/http_date.dart. (-5.36 points)

Analysis of lib/src/http_date.dart reported 11 hints, including:

line 9 col 19: Avoid const keyword.

line 10 col 17: Avoid const keyword.

line 25 col 29: Unnecessary new keyword.

line 27 col 5: Unnecessary new keyword.

line 29 col 5: Unnecessary new keyword.

Fix additional 5 files with analysis or formatting issues. (-9.90 points)

Additional issues in the following files:

  • lib/src/authentication_challenge.dart (6 hints)
  • lib/src/scan.dart (6 hints)
  • lib/src/chunked_coding/encoder.dart (5 hints)
  • lib/src/utils.dart (2 hints)
  • lib/src/chunked_coding.dart (1 hint)

Maintenance suggestions

Package is getting outdated. (-56.99 points)

The package was last published 81 weeks ago.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and http_parser.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.17.0 <3.0.0
charcode ^1.1.0 1.1.3
collection >=0.9.1 <2.0.0 1.14.12
source_span ^1.0.0 1.6.0
string_scanner >=0.0.0 <2.0.0 1.0.5
typed_data ^1.1.0 1.1.6
Transitive dependencies
meta 1.1.8
path 1.6.4
term_glyph 1.1.0
Dev dependencies
test >=0.12.42 <2.0.0