[11] [DFN[[CODE(ABNF)@en[[[product]]]]]] は、[[HTTP]]
において[[ソフトウェア]]を表す構文です。

* 仕様書

[REFS[
- [5] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-5.5.3>
]REFS]

* 文脈

[12] [CODE(HTTP)@en[[[User-Agent:]]]] [[ヘッダー]]と
[CODE(HTTP)@en[[[Server:]]]] [[ヘッダー]]で使われています。

* 構文

[6] 構文は、[[字句]]、または[[字句]]、[CODE[[[/]]]]、
[[字句]]の列と定義されています [SRC[>>5]]。前者の[[字句]]が名前を、
後者の[[字句]]が版を表します [SRC[>>5]]。

[FIG(railroad)[
= [[字句]]
= ?
== [CODE[[[/]]]]
== [[字句]]
]FIG]

[7] 実際にはこの構文は必ずしも守られていません。詳しくは
[CODE(HTTP)@en[[[User-Agent:]]]] と [CODE(HTTP)@en[[[Server:]]]]
を参照してください。

* 歴史

[FIG(quote)[
[FIGCAPTION[
[8] RFC 1945 (HTTP/1.0) 3.7; RFC 2068・2616 (HTTP/1.1) 3.8 Product Tokens
]FIGCAPTION]

> Product tokens are used to allow communicating applications to
identify themselves [DEL[via a simple product token, with an optional slash and version designator]] [INS[by software name and version]].
Most fields using product tokens also allow sub[INS[-]]products
which form a significant part of the application to be listed, separated by [DEL[[INS[{1945,2068}]] whitespace]] [INS[[INS[{2616}]] white space]].
By convention, the products are listed in order of their significance
for identifying the application.

[DFN[製品字句]]は、通信する[[応用]]がソフトウェア名・版で自身を識別することができるように使います。
製品字句を使うほとんどの欄は、その応用の重要な部分を担っている部分製品を[[空白]]で分離して列挙することも認めています。
慣習上、製品は識別する応用にとって重要な順に列挙します。

>
- product         = token ["/" product-version]
- product-version = token

> Examples:

例:

>
- User-Agent: CERN-LineMode/2.15 libwww/2.17b3
- Server: Apache/0.8.4

> Product tokens [DEL[[INS[{1945,2068]]] should]] [INS[SHOULD]] be short and to the point[INS[. [INS[{2616}]] They MUST NOT be used]] [DEL[[INS[{1945,2068}]] -- use of them]]
for [DEL[advertizing]] [INS[advertising]] or other non-essential information [DEL[[INS[{1945,2068}]] is explicitly forbidden]].  Although any token character [DEL[[INS[{1945,2068}]] may]] [INS[MAY]] appear in a product-version, this 
token [DEL[[INS[{1945]]] should]] [INS[SHOULD]] only be used for a version identifier
(i.e., successive versions of the same product [DEL[should]] [INS[SHOULD]] only differ in
the product-version portion of the product value).

製品字句は短く、的を射たものである'''べきです'''。
これを宣伝や他の非本質的な情報に使っては'''なりません'''。
[CODE(ABNF)[product-version]] では任意の字句文字を使っても構いませんが、
この字句は版識別子にのみ使用する'''べきです'''
(つまり、同じ製品の後継版は [CODE(ABNF)[product]] 値の [CODE(ABNF)[product-version]]
部分だけが異なる'''べきです''')。
]FIG]

* 関連

[9] [CODE(HTTP)@en[[[Via:]]]] 欄では [CODE(ABNF)@en[[[comment]]]]
が[[串]]のソフトウェアを識別するために使われています。

[10] [[プロトコルの版]]も [CODE(ABNF)@en[[[product]]]] 
と同じような構文ですが、仕様上は別のものとされています。

[13] [[Metalink]] の [CODE(XMLe)@en[[[generator]]]] [[要素]]も同様の構文を独自に定義しています。

* メモ

[1]
[CITE[PICSRules Specification]] <http://www.w3.org/TR/REC-PICSRules-971229#OrderOfOperations>

[CODE[[[creationTool]]]] 属性は
[CODE(HTTP)[[[User-Agent]]]] 欄と同じような書式を採用しています。

[FIG(quote)[
[FIGCAPTION[
[14] [CITE[OASIS Open Document Format for Office Applications (OpenDocument) Version 1.2 - Part 1: OpenDocument Schema]]
([TIME[2011-09-29 13:00:00 +09:00]] 版)
<http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#a4_3_2_1_meta_generator_>
]FIGCAPTION]

> The <meta:generator> element contains a string that identifies the OpenDocument producer that was used to create or last modify the document. This string should match the definition for user-agents in the HTTP protocol as specified in section 14.43 of '''['''RFC2616''']'''. 

]FIG]

