Skip to content
Novus Examples
har8.2 KB

HAR — JSON API Session (GET, POST, PUT, DELETE)

A four-call REST session against a fictional API host, with JSON request bodies in postData, an Authorization header carrying an obvious SAMPLE placeholder token, and a 204 response that has no body at all. The right shape for testing a HAR-to-mock-server or HAR-to-code converter.

Preview — first 50 lineshar
{
  "log": {
    "version": "1.2",
    "creator": {
      "name": "Novus Examples HAR writer",
      "version": "1.2",
      "comment": "HAR 1.2 - de-facto format from an abandoned W3C editorial draft (2012); never published as a W3C Recommendation"
    },
    "browser": {
      "name": "Sample Browser",
      "version": "126.0"
    },
    "pages": [
      {
        "startedDateTime": "2026-08-07T09:14:22.031Z",
        "id": "page_1",
        "title": "https://www.example.com/cart",
        "pageTimings": {
          "onContentLoad": 214.5,
          "onLoad": 388.9
        }
      }
    ],
    "entries": [
      {
        "pageref": "page_1",
        "startedDateTime": "2026-08-07T09:14:22.031Z",
        "time": 51.4,
        "request": {
          "method": "GET",
          "url": "https://api.example.com/v1/cart",
          "httpVersion": "HTTP/1.1",
          "cookies": [],
          "headers": [
            {
              "name": "Host",
              "value": "api.example.com"
            },
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (X11; Linux x86_64) NovusSampleAgent/1.0"
            },
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "Bearer SAMPLE-ACCESS-TOKEN-NOT-A-REAL-CREDENTIAL"
            }
308 lines total — download for the full file.

Specifications

Seed
61200
Encoding
UTF-8
Line Endings
LF
Har Version
1.2
Entries
4
Methods
GET, POST, PUT, DELETE
Has Post Data
true
Auth Scheme
Bearer (SAMPLE placeholder)
Status Codes
200, 201, 200, 204
Spec Status
HAR 1.2 - de-facto format from an abandoned W3C editorial draft (2012); never published as a W3C Recommendation

Testing contract

Expected to pass
Scenario
Replay a captured REST session against a mock server generated from the HAR.
Expected result
Four requests are reconstructed with their methods, JSON bodies and headers; the 204 entry produces a bodyless response rather than an empty-string body.

What is a .har file?

HAR (HTTP Archive) is a JSON format that records a browser or client's network activity. A log object carries the creator, one or more pages, and an ordered list of entries, each holding a full request and response — method, URL, headers, cookies, query string, POST data, status, content, transfer sizes — plus per-phase timings for DNS, connect, send, wait, and receive. Every major browser's developer tools can export one.

How to use this file

Use an example .har file to test waterfall viewers, performance-budget checkers, and traffic-replay or mock-server tooling, asserting that entry timings sum to the recorded total and that header, cookie, and body content is parsed without loss.

How to use this file for testing

“HAR — JSON API Session (GET, POST, PUT, DELETE)” is a deterministic Novus Examples fixture for API testing, Performance testing, JSON parsing. OpenAPI/Swagger specs, GraphQL SDL, JSON Schema, paginated and problem+json error payloads, and webhook samples — for testing API clients, mock servers, contract tests, and schema validators.

Documented properties for this file: seed 61200 · 4 entries · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Generated by generation/testing.py. Free for any use, no attribution required — license.