<?xml version="1.0" encoding="UTF-8"?>
<!--
    This XML document is the output of clean-for-DTD.xslt; a tool that strips
    extensions to RFC 7749 from documents for processing with xml2rfc.
-->
<!--TARGET-GENERATOR: 202007-->
<!--TARGET-VOCABULARY: 3-->
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc subcompact="no"?>
<?rfc rfcedstyle="yes"?>
<!--
  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
-->
<rfc sortRefs="true"
     category="info"
     ipr="trust200902"
     docName="draft-reschke-http-jfv-16"
     version="3">
<!--see https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/420-->
<?v3xml2rfc silence="Warning: Setting consensus="true" for IETF STD document"?>
<?v3xml2rfc silence="Warning: Expected a valid submissionType (stream) setting"?>
   <front>
      <title>A JSON Encoding for HTTP Field Values</title>
      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
         <organization abbrev="greenbytes">greenbytes GmbH</organization>
         <address>
            <postal>
               <street>Hafenweg 16</street>
               <city ascii="Muenster">Münster</city>
               <code>48155</code>
               <country>Germany</country>
            </postal>
            <email>julian.reschke@greenbytes.de</email>
            <uri>http://greenbytes.de/tech/webdav/</uri>
         </address>
      </author>
      <date year="2025" month="March" day="17"/>
      <area>Applications and Real-Time</area>
      <keyword>HTTP</keyword>
      <keyword>JSON</keyword>
      <keyword>Field Value</keyword>
      <abstract>
         <t>
      This document establishes a convention for use of JSON-encoded field
      values in new HTTP fields.
    </t>
      </abstract>
      <note title="Editorial Note">
         <t>This note is to be removed before publishing as an RFC.</t>
         <t>
      Distribution of this document is unlimited. Although this is not a work
      item of the HTTPbis Working Group, comments should be sent to the
      Hypertext Transfer Protocol (HTTP) mailing list at <eref target="mailto:ietf-http-wg@w3.org">ietf-http-wg@w3.org</eref>,
      which may be joined by sending a message with subject
      "subscribe" to <eref target="mailto:ietf-http-wg-request@w3.org?subject=subscribe">ietf-http-wg-request@w3.org</eref>.
    </t>
         <t>
      Discussions of the HTTPbis Working Group are archived at
      <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"
                  brackets="angle"/>.
    </t>
         <t>
      XML versions and latest edits for this document
      are available from <eref target="http://greenbytes.de/tech/webdav/#draft-reschke-http-jfv"
                  brackets="angle"/>.
    </t>
         <t>
      The changes in this draft are summarized in <xref target="changes.since.14"/>.
    </t>
      </note>
   </front>
   <middle>
      <section anchor="introduction" title="Introduction">
         <t>
  Defining syntax for new HTTP fields (<xref target="HTTP" sectionFormat="comma" section="5"/>) is non-trivial. Among the commonly encountered
  problems are:
</t>
         <ul>
            <li>There is no common syntax for complex field values. Several well-known
    fields do use a similarly looking syntax, but it is hard to write
    generic parsing code that will both correctly handle valid field values
    but also reject invalid ones.</li>
            <li>The HTTP message format allows field lines to repeat, so field syntax
    needs to be designed in a way that these cases are either meaningful,
    or can be unambiguously detected and rejected.</li>
            <li>HTTP does not define a character encoding scheme (<xref target="RFC6365" sectionFormat="comma" section="2"/>), so fields are either stuck with US-ASCII
    (<xref target="RFC0020"/>), or need out-of-band information
    to decide what encoding scheme is used. Furthermore, APIs
    usually assume a default encoding scheme in order to map from
    octet sequences to strings (for instance, <xref target="XMLHttpRequest"/>
    uses the IDL type "ByteString", effectively resulting in the
    ISO-8859-1 character encoding scheme <xref target="ISO-8859-1"/> being used).</li>
         </ul>
         <t>
  (See <xref target="HTTP" section="16.3"/>
  for a summary of considerations for new fields.)
</t>
         <t>
  This specification addresses the issues listed above by defining both a generic
  JSON-based (<xref target="RFC8259"/>) data model and a concrete
  wire format that can be used in definitions of new fields, where the
  goals were:
</t>
         <ul>
            <li>to be compatible with field recombination when field lines occur multiple
  times in a single message (<xref target="HTTP" section="5.3"/>), and</li>
            <li>not to use any problematic characters in the field value (non-ASCII characters and certain whitespace characters).</li>
         </ul>
         <section>
            <name>Relation to "Structured Field Values for HTTP" (<xref target="STRUCTURED-FIELDS"/>)</name>
            <t>
  "Structured Field Values for HTTP", an IETF RFC on the Standards Track, is a
  different approach to this set of problems. It uses a more compact
  notation, similar to what is used in existing header fields, and avoids
  several potential interoperability problems inherent to the use of JSON.
</t>
            <t>
  In general, that format is preferred for newly defined fields. The
  JSON-based format defined by this document might however be useful
  in case the data that needs to be transferred is already in JSON format,
  or features not covered by "Structured Field Values" are needed.
</t>
            <t>
  See <xref target="comparison"/> for more details.
</t>
         </section>
      </section>
      <!--<section title="Notational Conventions" anchor="notational.conventions">
<t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in <xref target="RFC2119"/>.
</t>
<t>
   This document reuses terminology used in the base HTTP specifications,
   namely <xref target="HTTP" x:fmt="of" x:rel="#fields"/>.
</t>
</section>-->
      <section anchor="data-model-and-format" title="Data Model and Format">
         <t>
  In HTTP, field lines with the same field name can occur multiple times
  within a single message (<xref target="HTTP" section="5.3"/>).
  When this happens, recipients are allowed to combine the field line values
  using  commas as delimiter, forming a combined "field value". This rule
  matches nicely JSON's array format
  (<xref target="RFC8259" section="5"/>). Thus, the basic data model
  used here is the JSON array.
</t>
         <t>
  Field definitions that need only a single value can restrict
  themselves to arrays of length 1, and are encouraged to define error
  handling in case more values are received (such as "first wins", "last wins",
  or "abort with fatal error message").
</t>
         <t>
  JSON arrays are mapped to field values by creating a sequence of
  serialized member elements, separated by commas and optionally whitespace. This
  is equivalent to using the full JSON array format, while leaving out
  the "begin-array" ('[') and "end-array" (']') delimiters.
</t>
         <t>
  The ABNF character names and classes below are used (copied
  from <xref target="RFC5234" sectionFormat="comma" section="B.1"/>):
</t>
         <sourcecode type="abnf2616"><![CDATA[  CR               = %x0D    ; carriage return
  HTAB             = %x09    ; horizontal tab
  LF               = %x0A    ; line feed
  SP               = %x20    ; space
  VCHAR            = %x21-7E ; visible (printing) characters
]]></sourcecode>
         <t>
  Characters in JSON strings that are not allowed or discouraged in HTTP
  field values -- that is, not in the "VCHAR" definition --
  need to be represented using JSON's "backslash" escaping mechanism
  (<xref target="RFC8259" sectionFormat="comma" section="7"/>).
</t>
         <t>
  The control characters CR, LF, and HTAB do not appear inside JSON
  strings, but can be used outside (line breaks, indentation etc.). These characters
  need to be either stripped or replaced by space characters (ABNF "SP").
</t>
         <t>
  Formally, using the HTTP specification's ABNF extensions defined in
  <xref target="HTTP" section="5.6.1"/>:
</t>
         <sourcecode type="abnf2616"><![CDATA[  json-field-value = #json-field-item
  json-field-item  = JSON-Text
                   ; see [RFC8259], Section 2,
                   ; post-processed so that only VCHAR characters
                   ; are used
]]></sourcecode>
      </section>
      <section title="Sender Requirements">
         <t>
  To map a JSON array to an HTTP field value, process each array
  element separately by:
</t>
         <ol>
            <li>generating the JSON representation,</li>
            <li>stripping all JSON control characters (CR, HTAB, LF), or replacing
      them by space ("SP") characters,</li>
            <li>replacing all remaining non-VSPACE characters by the equivalent
      backslash-escape sequence (<xref target="RFC8259" sectionFormat="comma" section="7"/>).</li>
         </ol>
         <t>
  The resulting list of strings is transformed into an HTTP field value
  by combining them using comma (%x2C) plus optional SP as delimiter,
  and encoding the resulting string into an octet sequence using the
  US-ASCII character encoding scheme (<xref target="RFC0020"/>).
</t>
         <section title="Example">
            <t>
  With the JSON data below, containing  the non-ASCII characters <u>ü</u>
  and <u>€</u>:
</t>
            <sourcecode type="json"><![CDATA[[
  {
    "destination": "Münster",
    "price": 123,
    "currency": "€"
  }
]
]]></sourcecode>
            <t>
  The generated field value would be:
</t>
            <sourcecode type="json"><![CDATA[{ "destination": "M\u00FCnster", "price": 123, "currency": "\u20AC" }
]]></sourcecode>
         </section>
      </section>
      <section title="Recipient Requirements">
         <t>
  To map a set of HTTP field line values to a JSON array:
</t>
         <ol>
            <li>combine all field line values into a single field value as per
    <xref target="HTTP" section="5.3"/>,</li>
            <li>add a leading begin-array ("[") octet and a trailing end-array ("]") octet, then</li>
            <li>run the resulting octet sequence through a JSON parser.</li>
         </ol>
         <t>
  The result of the parsing operation is either an error (in which case
  the field values needs to be considered invalid), or a JSON array.
</t>
         <section title="Example">
            <t>
  An HTTP message containing the field lines:
</t>
            <artwork type="http-message"><![CDATA[
Example: "\u221E"
Example: {"date":"2012-08-25"}
Example: [17,42]
]]></artwork>
            <t>
  would be parsed into the JSON array below:
</t>
            <sourcecode type="json"><![CDATA[[
  "∞",
  {
    "date": "2012-08-25"
  },
  [
    17,
    42
  ]
]
]]></sourcecode>
         </section>
      </section>
      <section anchor="using-this-format-in-header-field-definitions"
               title="Using this Format in Field Definitions">
         <t>
  Specifications defining new HTTP fields need to take the
  considerations listed in <xref target="HTTP" section="16.3"/>
  into account. Many of these will already be accounted for by using the
  format defined in this specification.
</t>
         <t>
  Readers of HTTP-related specifications frequently expect an ABNF definition
  of the field value syntax. This is not really needed here, as the actual
  syntax is JSON text, as defined in <xref target="RFC8259" section="2"/>.
</t>
         <t>
  A very simple way to use this JSON encoding thus is just to
  cite this specification -- specifically the "json-field-value" ABNF production
  defined in <xref target="data-model-and-format"/> -- and otherwise not to talk about the details of the field
  syntax at all.
</t>
         <t>
  An alternative approach is just to repeat the ABNF-related parts from <xref target="data-model-and-format"/>.
</t>
         <t>
  This frees the specification from defining the concrete on-the-wire syntax.
  What's left is defining the field value in terms of a JSON array. An
  important aspect is the question of extensibility, e.g. how recipients
  ought to treat unknown field names. In general, a "must ignore" approach
  will allow protocols to evolve without versioning or even using entire new
  field names.
</t>
         <!--<t>
  <cref>Explain what a definition of a new header field needs to do precisely
  to use this format, mention must-ignore extensibility</cref>
</t>-->
      </section>
      <section title="Deployment Considerations">
         <t>
  This JSON-based syntax will only apply to newly introduced
  fields, thus backwards compatibility is not a problem. That being
  said, it is conceivable that there is existing code that might trip over
  double quotes not being used for HTTP's quoted-string syntax
  (<xref target="HTTP" section="5.6.4"/>).
</t>
      </section>
      <section anchor="interop" title="Interoperability Considerations">
         <t>
  The "I-JSON Message Format" specification (<xref target="RFC7493"/>) addresses
  known JSON interoperability pain points. This specification borrows from
  the requirements made over there:
</t>
         <section title="Encoding and Characters">
            <t>
  This specification requires that field values use only US-ASCII characters,
  and thus by definition uses a subset of UTF-8 (<xref target="RFC7493" section="2.1"/>).
</t>
            <t>
  Furthermore, escape sequences in JSON strings (<xref target="RFC8259" section="7"/>)
  -- both in object member names and string values --
  are not allowed to represent non-Unicode code points such as unpaired surrogates or
  Noncharacters (see "General Structure" in <xref target="UNICODE"/>).
</t>
         </section>
         <section anchor="interop.numbers" title="Numbers">
            <t>
  Be aware of the issues around number precision, as discussed in <xref target="RFC7493" section="2.2"/>.
</t>
         </section>
         <section title="Object Constraints">
            <t>
  As described in <xref target="RFC8259" section="4"/>, JSON parser implementations
  differ in the handling of duplicate object names. Therefore, senders are not allowed to
  use duplicate object names, and recipients are advised to either treat
  field values with duplicate names as invalid (consistent with <xref target="RFC7493" sectionFormat="comma" section="2.3"/>)
  or use the lexically last value (consistent with <xref target="ECMA-262"
                     sectionFormat="comma"
                     section="24.3.1.1"
                     relative="#sec-internalizejsonproperty"/>).
</t>
            <t>
  Furthermore, ordering of object members is not significant and can not be relied upon.
</t>
         </section>
      </section>
      <section title="Internationalization Considerations">
         <t>
  In current versions of HTTP, field values are represented by octet sequences, usually used to
  transmit ASCII characters, with restrictions on the use of certain
  control characters, and no associated default character encoding, nor
  a way to describe it (<xref target="HTTP" sectionFormat="comma" section="5"/>).
</t>
         <t>
  This specification maps all characters which can cause problems to JSON
  escape sequences, thereby solving the HTTP field
  internationalization problem.
</t>
         <t>
  Future specifications of HTTP might change to allow non-ASCII characters
  natively. In that case, fields using the syntax defined by this
  specification would have a simple migration path (by just stopping
  to require escaping of non-ASCII characters).
</t>
      </section>
      <section title="Security Considerations">
         <t>
  Using JSON-shaped field values is believed to not introduce any new threads
  beyond those described in <xref target="RFC8259" section="12"/>, namely
  the risk of recipients using the wrong tools to parse them.
</t>
         <t>
  Other than that, any syntax that makes extensions easy can be used to
  smuggle information through field values; however, this concern is shared
  with other widely used formats, such as those using parameters in the
  form of name/value pairs.
</t>
      </section>
   </middle>
   <back>
      <references>
         <name>References</name>
         <references>
            <name>Normative References</name>
            <reference anchor="RFC0020" target="https://www.rfc-editor.org/info/rfc20">
               <front>
                  <title>ASCII format for network interchange</title>
                  <author fullname="V.G. Cerf" initials="V.G." surname="Cerf"/>
                  <date month="October" year="1969"/>
               </front>
               <seriesInfo name="STD" value="80"/>
               <seriesInfo name="RFC" value="20"/>
               <seriesInfo name="DOI" value="10.17487/RFC0020"/>
            </reference>
            <reference anchor="RFC5234" target="https://www.rfc-editor.org/info/rfc5234">
               <front>
                  <title>Augmented BNF for Syntax Specifications: ABNF</title>
                  <author fullname="D. Crocker"
                          initials="D."
                          role="editor"
                          surname="Crocker"/>
                  <author fullname="P. Overell" initials="P." surname="Overell"/>
                  <date month="January" year="2008"/>
               </front>
               <seriesInfo name="STD" value="68"/>
               <seriesInfo name="RFC" value="5234"/>
               <seriesInfo name="DOI" value="10.17487/RFC5234"/>
            </reference>
            <reference anchor="RFC7493" target="https://www.rfc-editor.org/info/rfc7493">
               <front>
                  <title>The I-JSON Message Format</title>
                  <author fullname="T. Bray" initials="T." role="editor" surname="Bray"/>
                  <date month="March" year="2015"/>
               </front>
               <seriesInfo name="RFC" value="7493"/>
               <seriesInfo name="DOI" value="10.17487/RFC7493"/>
            </reference>
            <reference anchor="RFC8259" target="https://www.rfc-editor.org/info/rfc8259"><!--included from rfc8259.xml-->
               <front>
                  <title abbrev="JSON">The JavaScript Object Notation (JSON) Data Interchange Format</title>
                  <author fullname="Tim Bray" initials="T." surname="Bray" role="editor">
                     <organization>Textuality</organization>
                     <address>
                        <email>tbray@textuality.com</email>
                     </address>
                  </author>
                  <date month="December" year="2017"/>
               </front>
               <seriesInfo name="RFC" value="8259"/>
               <seriesInfo name="DOI" value="10.17487/RFC8259"/>
            </reference>
            <reference anchor="HTTP" target="https://www.rfc-editor.org/info/rfc9110"><!--included from rfc9110.xml-->
               <front>
                  <title>HTTP Semantics</title>
                  <author fullname="Roy T. Fielding"
                          initials="R."
                          surname="Fielding"
                          role="editor">
                     <organization>Adobe</organization>
                     <address>
                        <postal>
                           <postalLine>345 Park Ave</postalLine>
                           <postalLine>San Jose, CA 95110</postalLine>
                           <postalLine>United States of America</postalLine>
                        </postal>
                        <email>fielding@gbiv.com</email>
                        <uri>https://roy.gbiv.com/</uri>
                     </address>
                  </author>
                  <author fullname="Mark Nottingham"
                          initials="M."
                          surname="Nottingham"
                          role="editor">
                     <organization>Fastly</organization>
                     <address>
                        <postal>
                           <postalLine>Prahran</postalLine>
                           <postalLine>Australia</postalLine>
                        </postal>
                        <email>mnot@mnot.net</email>
                        <uri>https://www.mnot.net/</uri>
                     </address>
                  </author>
                  <author fullname="Julian Reschke"
                          initials="J."
                          surname="Reschke"
                          role="editor">
                     <organization abbrev="greenbytes">greenbytes GmbH</organization>
                     <address>
                        <postal>
                           <postalLine>Hafenweg 16</postalLine>
                           <postalLine>48155 Münster</postalLine>
                           <postalLine>Germany</postalLine>
                        </postal>
                        <email>julian.reschke@greenbytes.de</email>
                        <uri>https://greenbytes.de/tech/webdav/</uri>
                     </address>
                  </author>
                  <date year="2022" month="June"/>
               </front>
               <seriesInfo name="RFC" value="9110"/>
               <seriesInfo name="DOI" value="10.17487/RFC9110"/>
            </reference>
            <reference anchor="STRUCTURED-FIELDS"
                       target="https://www.rfc-editor.org/info/rfc9651"><!--included from rfc9651.xml-->
               <front>
                  <title>Structured Field Values for HTTP</title>
                  <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
                     <organization>Cloudflare</organization>
                     <address>
                        <postal>
                           <city>Prahran</city>
                           <region>VIC</region>
                           <country>Australia</country>
                        </postal>
                        <email>mnot@mnot.net</email>
                        <uri>https://www.mnot.net/</uri>
                     </address>
                  </author>
                  <author initials="P-H." surname="Kamp" fullname="Poul-Henning Kamp">
                     <organization>The Varnish Cache Project</organization>
                     <address>
                        <email>phk@varnish-cache.org</email>
                     </address>
                  </author>
                  <date month="September" year="2024"/>
               </front>
               <seriesInfo name="RFC" value="9651"/>
               <seriesInfo name="DOI" value="10.17487/RFC9651"/>
            </reference>
            <reference anchor="UNICODE" target="http://www.unicode.org/versions/latest/">
               <front>
                  <title>The Unicode Standard</title>
                  <author>
                     <organization>The Unicode Consortium</organization>
                  </author>
                  <date/>
               </front>
            </reference>
         </references>
         <references>
            <name>Informative References</name>
            <reference anchor="ISO-8859-1">
               <front>
                  <title>Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1</title>
                  <author>
                     <organization>International Organization for Standardization</organization>
                  </author>
                  <date year="1998"/>
               </front>
               <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
            </reference>
            <reference anchor="RFC6365" target="https://www.rfc-editor.org/info/rfc6365">
               <front>
                  <title>Terminology Used in Internationalization in the IETF</title>
                  <author fullname="P. Hoffman" initials="P." surname="Hoffman"/>
                  <author fullname="J. Klensin" initials="J." surname="Klensin"/>
                  <date month="September" year="2011"/>
               </front>
               <seriesInfo name="BCP" value="166"/>
               <seriesInfo name="RFC" value="6365"/>
               <seriesInfo name="DOI" value="10.17487/RFC6365"/>
            </reference>
            <reference anchor="ECMA-262"
                       target="http://www.ecma-international.org/ecma-262/6.0/">
               <front>
                  <title>ECMA-262 6th Edition, The ECMAScript 2015 Language Specification</title>
                  <author>
                     <organization>Ecma International</organization>
                  </author>
                  <date year="2015" month="June"/>
               </front>
               <seriesInfo name="Standard" value="ECMA-262"/>
            </reference>
            <reference anchor="UNICHARS">
               <front>
                  <title>Unicode Character Repertoire Subsets</title>
                  <author fullname="Tim Bray" initials="T." surname="Bray"/>
                  <author fullname="Paul E. Hoffman" initials="P. E." surname="Hoffman"/>
                  <date day="3" month="March" year="2025"/>
               </front>
               <seriesInfo name="Internet-Draft" value="draft-bray-unichars-07"/>
            </reference>
            <reference anchor="UTF-8" target="https://www.rfc-editor.org/info/rfc3629">
               <front>
                  <title>UTF-8, a transformation format of ISO 10646</title>
                  <author fullname="F. Yergeau" initials="F." surname="Yergeau"/>
                  <date month="November" year="2003"/>
               </front>
               <seriesInfo name="STD" value="63"/>
               <seriesInfo name="RFC" value="3629"/>
               <seriesInfo name="DOI" value="10.17487/RFC3629"/>
            </reference>
            <reference anchor="XMLHttpRequest" target="https://xhr.spec.whatwg.org/">
               <front>
                  <title>XMLHttpRequest</title>
                  <author>
                     <organization>WhatWG</organization>
                  </author>
                  <date/>
               </front>
            </reference>
         </references>
      </references>
      <section anchor="comparison" title="Comparison with Structured Fields">
         <section title="Base Types">
            <table>
               <thead>
                  <tr>
                     <th>Type</th>
                     <th>in Structured Fields</th>
                     <th>in JSON-based Fields</th>
                  </tr>
               </thead>
               <tbody>
                  <tr>
                     <th rowspan="2">Integer</th>
                     <td>
                        <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.1"/>
                     </td>
                     <td>
                        <xref target="RFC8259" sectionFormat="comma" section="6"/>
                     </td>
                  </tr>
                  <tr>
                     <td>(restricted to 15 digits)</td>
                     <td/>
                  </tr>
                  <tr>
                     <th rowspan="2">Decimal</th>
                     <td>
                        <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.2"/>
                     </td>
                     <td>
                        <xref target="RFC8259" sectionFormat="comma" section="6"/>
                     </td>
                  </tr>
                  <tr>
                     <td>(a fixed point decimal restricted to 12 + 3 digits)</td>
                     <td/>
                  </tr>
                  <tr>
                     <th rowspan="2">String</th>
                     <td>
                        <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.3"/> and <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.8"/>
                     </td>
                     <td>
                        <xref target="RFC8259" sectionFormat="comma" section="7"/>
                     </td>
                  </tr>
                  <tr>
                     <td>Strings only support ASCII (<xref target="RFC0020"/>), but "Display Strings" cover anything encodable as <xref target="UTF-8"/>
      (that excludes surrogates (<xref target="UNICHARS" section="2.2.1"/>)).</td>
                     <td>JSON strings can transport any Unicode code point, due to the "\uxxxx" escape notation.</td>
                  </tr>
                  <tr>
                     <th>Token</th>
                     <td>
                        <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.4"/>
                     </td>
                     <td>not available, but can be mapped to strings</td>
                  </tr>
                  <tr>
                     <th>Byte Sequence</th>
                     <td>
                        <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.5"/>
                     </td>
                     <td>not available, usually mapped to strings using base64 encoding</td>
                  </tr>
                  <tr>
                     <th>Boolean</th>
                     <td>
                        <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.6"/>
                     </td>
                     <td>
                        <xref target="RFC8259" sectionFormat="comma" section="3"/>
                     </td>
                  </tr>
                  <tr>
                     <th>Date</th>
                     <td>
                        <xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.3.7"/>
                     </td>
                     <td>not available, usually mapped to Strings or Numbers</td>
                  </tr>
               </tbody>
            </table>
            <t>
  Structured Fields provide more data types (such as "token" or "byte sequence").
  Numbers are restricted, avoiding the JSON interop problems described
  in <xref target="interop.numbers"/>. 
</t>
         </section>
         <section title="Structures">
            <t>
  Structured Fields define Lists (<xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.1"/>),
  similar to JSON arrays (<xref target="RFC8259" sectionFormat="comma" section="5"/>), and
  Dictionaries (<xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.2"/>), similar to
  JSON objects (<xref target="RFC8259" sectionFormat="comma" section="4"/>).
</t>
            <t>
  In addition, most items in Structured Fields can be parametrized (<xref target="STRUCTURED-FIELDS" sectionFormat="comma" section="3.1.2"/>),
  attaching a dictionary-like structure to the value. To emulate this in JSON based field,
  an additional nesting of objects would be needed.
</t>
            <t>
  Finally, nesting of data structures is intentionally limited to two levels
  (see <xref target="STRUCTURED-FIELDS" section="A.1"/> for the motivation).
</t>
         </section>
      </section>
      <section anchor="implementations" title="Implementations">
         <t>This section is to be removed before publishing as an RFC.</t>
         <t>
  See <eref target="https://github.com/reschke/json-fields" brackets="angle"/> for a proof-of-concept (in development).
</t>
      </section>
      <section anchor="change.log" title="Change Log">
         <t>This section is to be removed before publishing as an RFC.</t>
         <section anchor="changes.since.00" title="Since draft-reschke-http-jfv-00">
            <t>
  Editorial fixes + working on the TODOs.
</t>
         </section>
         <section anchor="changes.since.01" title="Since draft-reschke-http-jfv-01">
            <t>
  Mention slightly increased risk of smuggling information in header field values.
</t>
         </section>
         <section anchor="changes.since.02" title="Since draft-reschke-http-jfv-02">
            <t>
  Mention Kazuho Oku's proposal for abbreviated forms.
</t>
            <t>
  Added a bit of text about the motivation for a concrete JSON subset (ack Cory Benfield).
</t>
            <t>
  Expand I18N section.
</t>
         </section>
         <section anchor="changes.since.03" title="Since draft-reschke-http-jfv-03">
            <t>
  Mention relation to KEY header field.
</t>
         </section>
         <section anchor="changes.since.04" title="Since draft-reschke-http-jfv-04">
            <t>
  Between June and December 2016, this was a work item of the HTTP
  working group (see <eref target="https://datatracker.ietf.org/doc/draft-ietf-httpbis-jfv/"
                     brackets="angle"/>).
  Work (if any) continues now on <eref target="https://datatracker.ietf.org/doc/draft-reschke-http-jfv/"
                     brackets="angle"/>.
</t>
            <t>
  Changes made while this was a work item of the HTTP Working Group:
</t>
         </section>
         <section anchor="changes.since.wg.00" title="Since draft-ietf-httpbis-jfv-00">
            <t>
  Added example for "Accept-Encoding" (inspired by Kazuho's feedback),
  showing a potential way to optimize the format when default values apply.
</t>
         </section>
         <section anchor="changes.since.wg.01" title="Since draft-ietf-httpbis-jfv-01">
            <t>
  Add interop discussion, building on I-JSON and ECMA-262 (see
  <eref target="https://github.com/httpwg/http-extensions/issues/225"
                     brackets="angle"/>).
</t>
         </section>
         <section anchor="changes.since.wg.02" title="Since draft-ietf-httpbis-jfv-02">
            <t>
  Move non-essential parts into appendix.
</t>
            <t>
  Updated XHR reference.
</t>
         </section>
         <section anchor="changes.since.05" title="Since draft-reschke-http-jfv-05">
            <t>
  Add meat to "Using this Format in Header Field Definitions".
</t>
            <t>
  Add a few lines on the relation to "Key".
</t>
            <t>
  Summarize current use of the format.
</t>
         </section>
         <section anchor="changes.since.06" title="Since draft-reschke-http-jfv-06">
            <t>
  RFC 5987 is obsoleted by RFC 8187.
</t>
            <t>
  Update CLEARSITE comment.
</t>
         </section>
         <section anchor="changes.since.07" title="Since draft-reschke-http-jfv-07">
            <t>
  Update JSON and HSTRUCT references.
</t>
            <t>
  FEATUREPOL doesn't use JSON syntax anymore.
</t>
         </section>
         <section anchor="changes.since.08" title="Since draft-reschke-http-jfv-08">
            <t>
  Update HSTRUCT reference.
</t>
            <t>
  Update notes about CLEARSITE and FEATUREPOL.
</t>
         </section>
         <section anchor="changes.since.09" title="Since draft-reschke-http-jfv-09">
            <t>
  Update HSTRUCT and FEATUREPOL references.
</t>
            <t>
  Update note about REPORTING.
</t>
            <t>
  Changed category to "informational".
</t>
         </section>
         <section anchor="changes.since.10" title="Since draft-reschke-http-jfv-10">
            <t>
  Update HSTRUCT reference.
</t>
         </section>
         <section anchor="changes.since.11" title="Since draft-reschke-http-jfv-11">
            <t>
  Update HSTRUCT reference.
</t>
            <t>
  Update note about FEATUREPOL (now using Structured Fields).
</t>
            <t>
  Reference <xref target="HTTP"/> instead if RFC723* and adjust (header)
  field terminology accordingly.
</t>
            <t>
  Remove discussion about the relation to KEY (as that spec is dormant:
  <eref target="https://datatracker.ietf.org/doc/draft-ietf-httpbis-key/"
                     brackets="angle"/>).
</t>
            <t>
  Remove appendices "Examples" and "Discussion".
</t>
            <t>
  Mark "Use of JSON Field Value Encoding in the Wild" for removal in RFC.
</t>
         </section>
         <section anchor="changes.since.12" title="Since draft-reschke-http-jfv-12">
            <t>
  Update HTTP reference and update terminology some more.
</t>
            <t>
  Update HSTRUCT reference (now RFC 8941).
</t>
         </section>
         <section anchor="changes.since.13" title="Since draft-reschke-http-jfv-13">
            <t>
  Update HTTP reference.
</t>
            <t>
  Mention test implementation.
</t>
            <t>
  Clarify that Unicode unpaired surrogates or Noncharacters must not be sent.
</t>
            <t>
  Rewrite text about <xref target="STRUCTURED-FIELDS"/>, add appendix comparing both formats.
</t>
            <t>
  And send/receive examples.
</t>
         </section>
         <section anchor="changes.since.14" title="Since draft-reschke-http-jfv-14">
            <t>
  Update HTTP reference.
</t>
            <t>
  Mention <xref target="STRUCTURED-FIELDS"/>.
</t>
         </section>
         <section anchor="changes.since.15" title="Since draft-reschke-http-jfv-15">
            <t>
  Cite <xref target="STRUCTURED-FIELDS"/> instead RFC 8941. Cite <xref target="UTF-8"/>
  and <xref target="UNICHARS"/>, and rework comparison chart for strings.
</t>
            <t>
  Removed appendix about use of this format in W3C specifications; they all have moved over
  to Structured Fields.
</t>
         </section>
      </section>
      <section anchor="acks" numbered="false" title="Acknowledgements">
         <t>
  Thanks go to the Hypertext Transfer Protocol Working Group participants.
</t>
      </section>
   </back>
</rfc>
