Description
Construct single-tag conditional requests with explicit existence and epoch-second date inputs, applying tag-before-date precedence and GET/HEAD response decisions.
A protocol fixture is local test data representing headers, messages, identifiers, or request decisions. Serialization and parsing can be checked without contacting a server, while authentication, delivery, and actual client behavior require separate tests.
Construct single-tag conditional requests with explicit existence and epoch-second date inputs, applying tag-before-date precedence and GET/HEAD response decisions.
When to use this tool
Use this generator to create reproducible http conditional request fixture cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply currentEtag, tags, methods, conditions, exists, modifiedSeconds, conditionSeconds, count in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read cases. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Draw a method and one selected tag/date precondition. Apply strong If-Match comparison, weak If-None-Match comparison, or the selected modified/unmodified date rule, returning modeled 200, 304, or 412 and a reason; companion date headers are included for tag cases.1
Delegated operations used for this result: etag parser. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| currentEtag | Current Etag | Required. Text; maximum UTF-16 length 65536. |
| tags | Tags | Required. Array of Text; maximum UTF-16 length 65536.; minimum items 1; maximum items 16. |
| methods | Methods | Required. Array of Text; one of "GET", "HEAD", "PUT".; minimum items 1; maximum items 3. |
| conditions | Conditions | Required. Array of Text; one of "if-match", "if-none-match", "if-modified-since", "if-unmodified-since".; minimum items 1; maximum items 4. |
| exists | Exists | Required. Boolean. |
| modifiedSeconds | Modified Seconds | Required. Safe integer. |
| conditionSeconds | Condition Seconds | Required. Safe integer. |
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 1; maximum 32. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| cases | Cases | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| cases[].method | Method | Required. Text; maximum UTF-16 length 65536. |
| cases[].condition | Condition | Required. Text; maximum UTF-16 length 65536. |
| cases[].headers | Headers | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 2. |
| cases[].headers[].name | Name | Required. Text; maximum UTF-16 length 65536. |
| cases[].headers[].value | Value | Required. Text; maximum UTF-16 length 65536. |
| cases[].status | Named outcome; inspect null and error fields before interpreting associated values. | Required. Safe integer; minimum 200; maximum 412. |
| cases[].reason | Reason | Required. Text; maximum UTF-16 length 65536. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"currentEtag": "\"v2\"",
"tags": [
"W/\"v2\""
],
"methods": [
"GET"
],
"conditions": [
"if-none-match"
],
"exists": true,
"modifiedSeconds": 100,
"conditionSeconds": 0,
"count": 1,
"seed": 42
},
"output": {
"cases": [
{
"method": "GET",
"condition": "if-none-match",
"headers": [
{
"name": "if-none-match",
"value": "W/\"v2\""
},
{
"name": "if-modified-since",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
}
],
"status": 304,
"reason": "weak-tag-match"
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- This is the stated bounded conditional model, not every HTTP precondition combination or wildcard/list grammar. Times are integer epoch seconds; representation changes, request processing, and network behavior are not executed.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random HTTP Basic Auth Parser Corpus Generator
Construct synthetic ASCII Basic credential bytes and malformed controls, preserving delegated split and error outcomes without real credentials.
- Random HTTP Bearer Shape Corpus Generator
Construct fake Bearer header casing and whitespace variants with malformed-token controls and delegated extraction answers.