structured_field_values 1.0.0
structured_field_values: ^1.0.0 copied to clipboard
A Dart native implementation of Structured Field Values for HTTP (RFC 9651)
example/structured_field_values_example.dart
// Allow print for demos
// ignore_for_file: avoid_print
import 'package:structured_field_values/structured_field_values.dart';
void main() {
// Parsing an HTTP header value using the specialized codec
const headerValue = 'a=?0, b, c;foo=bar';
final parsed = structuredDictionary.decode(headerValue);
print('Parsed dictionary: $parsed');
// Serializing back to a header value string
final serialized = structuredDictionary.encode(parsed);
print('Serialized header: $serialized');
}