HTTP Accept header中的“+”是什么意思?

What does "+" means in HTTP Accept header?

我怎么理解这条记录:

Accept: application/vnd.my.api+json

我的意思是,这个“+”符号是标准化的(无论如何,我没有在规范中找到它),还是只是一种约定?

谢谢。

Accept header 指定可接受媒体类型的列表。 媒体类型的“+xxx”部分称为后缀。它是对媒体类型定义的扩充,有助于指定该媒体类型的底层结构。

RFC 6838,《4.2.8.结构化语法名称后缀》定义:

XML in MIME [RFC3023] defined the first such augmentation to the
media type definition to additionally specify the underlying
structure of that media type. To quote:

  This document also standardizes a convention (using the suffix
  '+xml') for naming media types ... when those media types
  represent XML MIME (Multipurpose Internet Mail Extensions)
  entities.

That is, it specified a suffix (in that case, "+xml") to be appended to the base subtype name.

Since this was published, the de facto practice has arisen for using this suffix convention for other well-known structuring syntaxes. In particular, media types have been registered with suffixes such as "+der", "+fastinfoset", and "+json". This specification formalizes this practice and sets up a registry for structured type name suffixes.

The primary guideline for whether a structured type name suffix is registrable is that it be described by a readily available
description, preferably within a document published by an established standards-related organization, and for which there's a reference
that can be used in a Normative References section of an RFC.

Media types that make use of a named structured syntax SHOULD use the appropriate registered "+suffix" for that structured syntax when they are registered. By the same token, media types MUST NOT be given names incorporating suffixes for structured syntaxes they do not actually employ. "+suffix" constructs for as-yet unregistered structured syntaxes SHOULD NOT be used, given the possibility of conflicts with future suffix definitions.