Skip to content

Main content

Media Type Structured Suffix Token Tool

Calculate media type structured suffix token from explicit caller-supplied inputs.

Loading tool…

Description

Split at its last + when present, rejecting a plus only at the first or last position; return base, suffix, and present, using an empty suffix when absent.

Media-type and MIME parameter text can include quoted strings, structured suffixes, charsets, language tags, and percent-encoded values. Splitting the syntax is separate from decoding its encoding or verifying a registered type. A local token parser may implement a deliberately limited character grammar.

Split at its last + when present, rejecting a plus only at the first or last position; return base, suffix, and present, using an empty suffix when absent.

When to use this tool

Use Media Type Structured Suffix Token when you need the stated media/MIME parameter split, quote decoding, or suffix extraction.

How to use the tool and how it works

  1. Enter subtype. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read base, suffix, present. Inspect present before interpreting the associated values.

Require a nonempty ASCII subtype token from the implemented character set. Split at its last + when present, rejecting a plus only at the first or last position; return base, suffix, and present, using an empty suffix when absent.1

Input fieldMeaning and unitsAccepted input
subtypeSubtypeRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
baseBaseRequired. Text; maximum UTF-16 length 8192.
suffixSuffixRequired. Text; maximum UTF-16 length 8192.
presentWhether an internal final-plus suffix was present.Required. Boolean.
json
{
  "input": {
    "subtype": "problem+json"
  },
  "output": {
    "base": "problem",
    "suffix": "json",
    "present": true
  }
}

Limitations and assumptions

  • Case is preserved and multiple internal plus signs are allowed. The suffix is not checked against an IANA registry and no top-level type, parameter, or full media-type grammar is parsed.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a complete header parser and explicit charset/percent decoding for an entire media parameter. Consult the relevant registration and grammar when semantic validity matters.

References

  1. Calculation and input contract: parse/media-type-structured-suffix-token — tool.io

Similar or alternative tools