accept string required Accept field with 1–32 media ranges.
Parse RFC 9110 Accept media ranges and deterministically select the best available representation using specificity, parameters and q weights.
Authoritative reference data or standards computation
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
accept
required
| string | allowed: 3 – 2048 example: text/html, application/json;q=0.8 | Accept field with 1–32 media ranges. |
accept string required Accept field with 1–32 media ranges.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: accept,count | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: ranges | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
accept | string | Input Accept field value. | text/html, application/json;q=0.8 |
count | integer | Number of parsed media ranges. | 2 |
ranges | object[] | Ranges with normalized type/subtype, parameters, q, specificity and original order. | [{"mediaRange":"text/html","type":"text","subtype":"html","parameters":[],"q":1,"specificity":2,"order":0}] |
accept string Input Accept field value.
example: text/html, application/json;q=0.8
count integer Number of parsed media ranges.
example: 2
ranges object[] Ranges with normalized type/subtype, parameters, q, specificity and original order.
example: [{"mediaRange":"text/html","type":"text","subtype":"html","parameters":[],"q":1,"specificity":2,"order":0}]
/api/content-negotiation/parse?accept=text%2Fhtml%2C%20application%2Fjson%3Bq%3D0.8 {
"data": {
"accept": "text/html, application/json;q=0.8",
"count": 2,
"ranges": [
{
"mediaRange": "text/html",
"type": "text",
"subtype": "html",
"parameters": [],
"q": 1,
"specificity": 2,
"order": 0
},
{
"mediaRange": "application/json;q=0.8",
"type": "application",
"subtype": "json",
"parameters": [],
"q": 0.8,
"specificity": 2,
"order": 1
}
]
},
"meta": {
"endpoint": "content-negotiation",
"route": "/parse",
"params": {
"accept": "text/html, application/json;q=0.8"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/content-negotiation/parse?accept=application%2Fjson%3Bprofile%3D%22compact%22%2C%20*%2F*%3Bq%3D0.1 {
"data": {
"accept": "application/json;profile=\"compact\", */*;q=0.1",
"count": 2,
"ranges": [
{
"mediaRange": "application/json;profile=compact",
"type": "application",
"subtype": "json",
"parameters": [
{
"name": "profile",
"value": "compact"
}
],
"q": 1,
"specificity": 2,
"order": 0
},
{
"mediaRange": "*/*;q=0.1",
"type": "*",
"subtype": "*",
"parameters": [],
"q": 0.1,
"specificity": 0,
"order": 1
}
]
},
"meta": {
"endpoint": "content-negotiation",
"route": "/parse",
"params": {
"accept": "application/json;profile=\"compact\", */*;q=0.1"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} | Parameter | Type | Default & allowed | Description |
|---|---|---|---|
accept
required
| string | allowed: 3 – 2048 example: application/json, text/html;q=0.8 | Accept field with 1–32 weighted media ranges. |
available
required
| string | allowed: 3 – 2048 example: text/html, application/json | Comma-separated list of 1–32 concrete media types offered by the server. |
accept string required Accept field with 1–32 weighted media ranges.
available string required Comma-separated list of 1–32 concrete media types offered by the server.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: accept,available | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: matchedParameters | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
accept | string | Input Accept field value. | application/json, text/html;q=0.8 |
available | string[] | Parsed concrete representations in supplied order. | ["text/html","application/json"] |
matched | boolean | Whether at least one representation has a controlling range with q above zero. | true |
selected nullable | string | Selected canonical media type, or null when none is acceptable. | application/json |
selectedIndex nullable | integer | Zero-based position in available, or null when unmatched. | 1 |
matchedRange nullable | string | Controlling canonical Accept media range, or null. | application/json |
q nullable | float | Quality assigned by the controlling range, or null. | 1 |
specificity nullable | integer | Controlling wildcard specificity: 0 for */*, 1 for type/*, 2 for exact. | 2 |
matchedParameters nullable | integer | Number of media parameters on the controlling range, or null. | 0 |
accept string Input Accept field value.
example: application/json, text/html;q=0.8
available string[] Parsed concrete representations in supplied order.
example: ["text/html","application/json"]
matched boolean Whether at least one representation has a controlling range with q above zero.
example: true
selected string nullable Selected canonical media type, or null when none is acceptable.
example: application/json
selectedIndex integer nullable Zero-based position in available, or null when unmatched.
example: 1
matchedRange string nullable Controlling canonical Accept media range, or null.
example: application/json
q float nullable Quality assigned by the controlling range, or null.
example: 1
specificity integer nullable Controlling wildcard specificity: 0 for */*, 1 for type/*, 2 for exact.
example: 2
matchedParameters integer nullable Number of media parameters on the controlling range, or null.
example: 0
/api/content-negotiation/select?accept=application%2Fjson%2Ctext%2Fhtml%3Bq%3D0.8&available=text%2Fhtml%2Capplication%2Fjson {
"data": {
"accept": "application/json,text/html;q=0.8",
"available": [
"text/html",
"application/json"
],
"matched": true,
"selected": "application/json",
"selectedIndex": 1,
"matchedRange": "application/json",
"q": 1,
"specificity": 2,
"matchedParameters": 0
},
"meta": {
"endpoint": "content-negotiation",
"route": "/select",
"params": {
"accept": "application/json,text/html;q=0.8",
"available": "text/html,application/json"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/content-negotiation/select?accept=*%2F*%3Bq%3D1%2Capplication%2Fjson%3Bq%3D0&available=application%2Fjson%2Ctext%2Fplain {
"data": {
"accept": "*/*;q=1,application/json;q=0",
"available": [
"application/json",
"text/plain"
],
"matched": true,
"selected": "text/plain",
"selectedIndex": 1,
"matchedRange": "*/*;q=1",
"q": 1,
"specificity": 0,
"matchedParameters": 0
},
"meta": {
"endpoint": "content-negotiation",
"route": "/select",
"params": {
"accept": "*/*;q=1,application/json;q=0",
"available": "application/json,text/plain"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} Strict, bounded parsing and selection for the HTTP Accept request field defined by RFC 9110. The parser understands exact media types, type/* and */* wildcards, media parameters, quoted parameter values and quality weights from 0 through 1 with no more than three decimal places. It accepts at most 32 comma-separated entries and rejects malformed or duplicate parameters.
/select compares an Accept value with concrete available representations. For each representation, the most specific matching range controls its quality: exact type/subtype beats a type wildcard, which beats */*; more matching media parameters break a specificity tie; earlier field order breaks the remaining tie. This means a specific q=0 exclusion is not overridden by a broader positive wildcard.
Among acceptable representations, selection is deterministic: quality first, then controlling specificity, matched parameter count, Accept order and finally available-list order. Type, subtype and charset names compare case-insensitively; other parameter values compare exactly because their sensitivity is defined by each media type. The endpoint does not inspect response bodies, infer filename extensions or implement other negotiation dimensions such as language or content coding.
For each available representation, the most specific matching range controls its q value. Exact type/subtype beats type/*, which beats /, and matching media parameters add specificity.
Yes. If application/json;q=0 is the controlling exact range, a broader /;q=1 does not make JSON acceptable.
Yes. Selection uses q, specificity, parameter count, Accept order and then available-list order, in that order.
No. This endpoint handles media types from Accept only; it does not process Accept-Language, Accept-Encoding or response bodies.
Complete pinned IANA HTTP field-name registry with status, Structured Field type, references, search and case-insensitive lookup.
The complete IANA media type registry with file extensions merged in — look up any type or extension, or strictly parse a Content-Type value into its parts.
The complete IANA HTTP status code registry with practical descriptions, defining RFCs and a retryable flag — list by category or look up a single code.
Parse and resolve bounded RFC 9110 byte Range sets, plus validate satisfied, unknown-length and unsatisfied Content-Range field values.