http_archive 0.2.0
http_archive: ^0.2.0 copied to clipboard

Helps in reading/writing '.har' (archival format for HTTP transactions) data.

example/http_archive_example.dart

import 'dart:convert';
import 'dart:io';

import 'package:http_archive/http_archive.dart';

void main() {
  const harJsonContentString = '''
    {
    "log": {
      "entries": [
        {
          "request": {
            "method": "GET",
            "url": "https://smth.com/data"
          },
          "response": {
            "status": 200,
            "content": {
              "mimeType": "application/json",
              "text": "Hey, this is response, most other fields are omitted for simplicity's sake."
            }
          }
        }
      ]
    }
  }  
  ''';
  final jsonMap = jsonDecode(harJsonContentString) as Map<String, dynamic>;
  final harRoot = HarRoot.fromJson(jsonMap);
  stdout.writeln('Response text: ${harRoot.log.entries[0].response.content.text}');
}
1
likes
120
pub points
61%
popularity

Publisher

pasul.dev

Helps in reading/writing '.har' (archival format for HTTP transactions) data.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

equatable, json_annotation, meta

More

Packages that depend on http_archive