DICOM PS3.18 2020e - Web Services

8.7 Media Types (Current)
Prev | 8 Common Aspects of DICOM Web Services | Next

## 8.7 Media Types

Media types are the basis for both content negotiation and data typing of message payloads. Each PS3.18 service, and/or transaction defines the media types and associated representations that are default, required and optional.

The media type also specifies whether the payload contains a single representation (single part), or multiple representations (multipart). Multipart payloads are only defined for the RESTful APIs. See Section 8.6.1.2 and Section 10.4.3.

Media types are identifiers used to define the data format of a representation. HTTP uses media types in the Content-Type and Accept header fields to provide open and extensible data typing and type negotiation. The syntax of media types is:

    media-type = type "/" subtype *(OWS ";" OWS mt-parameter)

Where

    type         = token
    subtype      = token
    mt-parameter = mtp-name "=" mtp-value
    mtp-name     = token
    mtp-value    = (token / quoted-string)

The 'type/subtype' may be followed by parameters in the form of 'name "=" value' pairs.

The type, subtype, and mtp-name tokens are case-insensitive, but the case sensitivity of parameter values depends on the semantics of the parameter name. The presence or absence of a parameter might be significant to the processing of a media-type, depending on its definition within the media type registry.

An mtp-value can be transmitted either as a token or quoted-string. The quoted and unquoted values are equivalent.

Media types are defined in [RFC7231] Section 3.1.1.1.

IANA maintains a registry of media types [IANA Media Types].

Many media types specify a character set parameter.

### Note

The term "MIME Type" is not synonymous with "Media Type". MIME types are defined by Multipurpose Internet Mail Extensions [RFC2045] and used by email programs. Media Types are defined by Media Type Specifications and Registration Procedures [RFC6838].

### 8.7.1 Multipart Media Types

Some of the services defined in this Part of the Standard support the multipart media types [RFC2387]. The syntax is:

    multipart-media-type = "multipart" "/" subtype *(OWS ";" OWS parameter)

The application/multipart-related media type is used by the RESTful services. Its syntax is:

    multipart-related = "multipart/related"
                        OWS ";" OWS "type" "=" DQ media-type DQ
                        OWS ";" OWS "boundary" "=" boundary
                        [related-parameters]

Where

    boundary           ; See Section 8.6.1.2.1

    bchar              = bchar-nospace / SP
    bchar-nospace      = DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" / "," / "-"
                         / "." / "/" / ":" / "=" / "?" "/" / ":" / "=" / "?"
    related-parameters = [";" "start" "=" cid]
                         [";" "start-info" "=" cid-list]
    cid-list           = cid cid-list
    cid                = token / quoted-string

The "type" parameter is required. It contains the media type of the "root" body part. It always contains the special character "/" and thus requires quote marks.

The cid is a content identifier. It should be unique for each part of the multipart message.

Typically, the "start" and "start-info" parameters are not specified, and the "root" is the first body part.

Prev | Up | Next
8.6.3 Status Report | Home | 8.7.2 DICOM Resource Categories

DICOM PS3.18 2020e - Web Services