CINXE.COM

RFC 8941: Structured Field Values for HTTP

<!DOCTYPE html> <html lang="en" class="RFC"> <head> <meta charset="utf-8"> <meta content="Common,Latin" name="scripts"> <meta content="initial-scale=1.0" name="viewport"> <title>RFC 8941: Structured Field Values for HTTP</title> <meta content="Mark Nottingham" name="author"> <meta content="Poul-Henning Kamp" name="author"> <meta content=' This document describes a set of data types and associated algorithms that are intended to make it easier and safer to define and handle HTTP header and trailer fields, known as "Structured Fields", "Structured Headers", or "Structured Trailers". It is intended for use by specifications of new HTTP fields that wish to use a common syntax that is more restrictive than traditional HTTP field values. ' name="description"> <meta content="xml2rfc 3.5.0" name="generator"> <meta content="8941" name="rfc.number"> <!-- Generator version information: xml2rfc 3.5.0 Python 3.6.10 appdirs 1.4.4 ConfigArgParse 1.2.3 google-i18n-address 2.3.5 html5lib 1.0.1 intervaltree 3.0.2 Jinja2 2.11.2 kitchen 1.2.6 lxml 4.4.2 pycairo 1.19.0 pycountry 19.8.18 pyflakes 2.1.1 PyYAML 5.3.1 requests 2.22.0 setuptools 40.6.2 six 1.14.0 WeasyPrint 51 --> <link href="rfc8941.xml" rel="alternate" type="application/rfc+xml"> <link href="#copyright" rel="license"> <style type="text/css">/* NOTE: Changes at the bottom of this file overrides some earlier settings. Once the style has stabilized and has been adopted as an official RFC style, this can be consolidated so that style settings occur only in one place, but for now the contents of this file consists first of the initial CSS work as provided to the RFC Formatter (xml2rfc) work, followed by itemized and commented changes found necssary during the development of the v3 formatters. */ /* fonts */ @import url('https://fonts.googleapis.com/css?family=Noto+Sans'); /* Sans-serif */ @import url('https://fonts.googleapis.com/css?family=Noto+Serif'); /* Serif (print) */ @import url('https://fonts.googleapis.com/css?family=Roboto+Mono'); /* Monospace */ @viewport { zoom: 1.0; width: extend-to-zoom; } @-ms-viewport { width: extend-to-zoom; zoom: 1.0; } /* general and mobile first */ html { } body { max-width: 90%; margin: 1.5em auto; color: #222; background-color: #fff; font-size: 14px; font-family: 'Noto Sans', Arial, Helvetica, sans-serif; line-height: 1.6; scroll-behavior: smooth; } .ears { display: none; } /* headings */ #title, h1, h2, h3, h4, h5, h6 { margin: 1em 0 0.5em; font-weight: bold; line-height: 1.3; } #title { clear: both; border-bottom: 1px solid #ddd; margin: 0 0 0.5em 0; padding: 1em 0 0.5em; } .author { padding-bottom: 4px; } h1 { font-size: 26px; margin: 1em 0; } h2 { font-size: 22px; margin-top: -20px; /* provide offset for in-page anchors */ padding-top: 33px; } h3 { font-size: 18px; margin-top: -36px; /* provide offset for in-page anchors */ padding-top: 42px; } h4 { font-size: 16px; margin-top: -36px; /* provide offset for in-page anchors */ padding-top: 42px; } h5, h6 { font-size: 14px; } #n-copyright-notice { border-bottom: 1px solid #ddd; padding-bottom: 1em; margin-bottom: 1em; } /* general structure */ p { padding: 0; margin: 0 0 1em 0; text-align: left; } div, span { position: relative; } div { margin: 0; } .alignRight.art-text { background-color: #f9f9f9; border: 1px solid #eee; border-radius: 3px; padding: 1em 1em 0; margin-bottom: 1.5em; } .alignRight.art-text pre { padding: 0; } .alignRight { margin: 1em 0; } .alignRight > *:first-child { border: none; margin: 0; float: right; clear: both; } .alignRight > *:nth-child(2) { clear: both; display: block; border: none; } svg { display: block; } .alignCenter.art-text { background-color: #f9f9f9; border: 1px solid #eee; border-radius: 3px; padding: 1em 1em 0; margin-bottom: 1.5em; } .alignCenter.art-text pre { padding: 0; } .alignCenter { margin: 1em 0; } .alignCenter > *:first-child { border: none; /* this isn't optimal, but it's an existence proof. PrinceXML doesn't support flexbox yet. */ display: table; margin: 0 auto; } /* lists */ ol, ul { padding: 0; margin: 0 0 1em 2em; } ol ol, ul ul, ol ul, ul ol { margin-left: 1em; } li { margin: 0 0 0.25em 0; } .ulCompact li { margin: 0; } ul.empty, .ulEmpty { list-style-type: none; } ul.empty li, .ulEmpty li { margin-top: 0.5em; } ul.compact, .ulCompact, ol.compact, .olCompact { line-height: 100%; margin: 0 0 0 2em; } /* definition lists */ dl { } dl > dt { float: left; margin-right: 1em; } /* dl.nohang > dt { float: none; } */ dl > dd { margin-bottom: .8em; min-height: 1.3em; } dl.compact > dd, .dlCompact > dd { margin-bottom: 0em; } dl > dd > dl { margin-top: 0.5em; margin-bottom: 0em; } /* links */ a { text-decoration: none; } a[href] { color: #22e; /* Arlen: WCAG 2019 */ } a[href]:hover { background-color: #f2f2f2; } figcaption a[href], a[href].selfRef { color: #222; } /* XXX probably not this: a.selfRef:hover { background-color: transparent; cursor: default; } */ /* Figures */ tt, code, pre, code { background-color: #f9f9f9; font-family: 'Roboto Mono', monospace; } pre { border: 1px solid #eee; margin: 0; padding: 1em; } img { max-width: 100%; } figure { margin: 0; } figure blockquote { margin: 0.8em 0.4em 0.4em; } figcaption { font-style: italic; margin: 0 0 1em 0; } @media screen { pre { overflow-x: auto; max-width: 100%; max-width: calc(100% - 22px); } } /* aside, blockquote */ aside, blockquote { margin-left: 0; padding: 1.2em 2em; } blockquote { background-color: #f9f9f9; color: #111; /* Arlen: WCAG 2019 */ border: 1px solid #ddd; border-radius: 3px; margin: 1em 0; } cite { display: block; text-align: right; font-style: italic; } /* tables */ table { width: 100%; margin: 0 0 1em; border-collapse: collapse; border: 1px solid #eee; } th, td { text-align: left; vertical-align: top; padding: 0.5em 0.75em; } th { text-align: left; background-color: #e9e9e9; } tr:nth-child(2n+1) > td { background-color: #f5f5f5; } table caption { font-style: italic; margin: 0; padding: 0; text-align: left; } table p { /* XXX to avoid bottom margin on table row signifiers. If paragraphs should be allowed within tables more generally, it would be far better to select on a class. */ margin: 0; } /* pilcrow */ a.pilcrow { color: #666; /* Arlen: AHDJ 2019 */ text-decoration: none; visibility: hidden; user-select: none; -ms-user-select: none; -o-user-select:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; } @media screen { aside:hover > a.pilcrow, p:hover > a.pilcrow, blockquote:hover > a.pilcrow, div:hover > a.pilcrow, li:hover > a.pilcrow, pre:hover > a.pilcrow { visibility: visible; } a.pilcrow:hover { background-color: transparent; } } /* misc */ hr { border: 0; border-top: 1px solid #eee; } .bcp14 { font-variant: small-caps; } .role { font-variant: all-small-caps; } /* info block */ #identifiers { margin: 0; font-size: 0.9em; } #identifiers dt { width: 3em; clear: left; } #identifiers dd { float: left; margin-bottom: 0; } #identifiers .authors .author { display: inline-block; margin-right: 1.5em; } #identifiers .authors .org { font-style: italic; } /* The prepared/rendered info at the very bottom of the page */ .docInfo { color: #666; /* Arlen: WCAG 2019 */ font-size: 0.9em; font-style: italic; margin-top: 2em; } .docInfo .prepared { float: left; } .docInfo .prepared { float: right; } /* table of contents */ #toc { padding: 0.75em 0 2em 0; margin-bottom: 1em; } nav.toc ul { margin: 0 0.5em 0 0; padding: 0; list-style: none; } nav.toc li { line-height: 1.3em; margin: 0.75em 0; padding-left: 1.2em; text-indent: -1.2em; } /* references */ .references dt { text-align: right; font-weight: bold; min-width: 7em; } .references dd { margin-left: 8em; overflow: auto; } .refInstance { margin-bottom: 1.25em; } .references .ascii { margin-bottom: 0.25em; } /* index */ .index ul { margin: 0 0 0 1em; padding: 0; list-style: none; } .index ul ul { margin: 0; } .index li { margin: 0; text-indent: -2em; padding-left: 2em; padding-bottom: 5px; } .indexIndex { margin: 0.5em 0 1em; } .index a { font-weight: 700; } /* make the index two-column on all but the smallest screens */ @media (min-width: 600px) { .index ul { -moz-column-count: 2; -moz-column-gap: 20px; } .index ul ul { -moz-column-count: 1; -moz-column-gap: 0; } } /* authors */ address.vcard { font-style: normal; margin: 1em 0; } address.vcard .nameRole { font-weight: 700; margin-left: 0; } address.vcard .label { font-family: "Noto Sans",Arial,Helvetica,sans-serif; margin: 0.5em 0; } address.vcard .type { display: none; } .alternative-contact { margin: 1.5em 0 1em; } hr.addr { border-top: 1px dashed; margin: 0; color: #ddd; max-width: calc(100% - 16px); } /* temporary notes */ .rfcEditorRemove::before { position: absolute; top: 0.2em; right: 0.2em; padding: 0.2em; content: "The RFC Editor will remove this note"; color: #9e2a00; /* Arlen: WCAG 2019 */ background-color: #ffd; /* Arlen: WCAG 2019 */ } .rfcEditorRemove { position: relative; padding-top: 1.8em; background-color: #ffd; /* Arlen: WCAG 2019 */ border-radius: 3px; } .cref { background-color: #ffd; /* Arlen: WCAG 2019 */ padding: 2px 4px; } .crefSource { font-style: italic; } /* alternative layout for smaller screens */ @media screen and (max-width: 1023px) { body { padding-top: 2em; } #title { padding: 1em 0; } h1 { font-size: 24px; } h2 { font-size: 20px; margin-top: -18px; /* provide offset for in-page anchors */ padding-top: 38px; } #identifiers dd { max-width: 60%; } #toc { position: fixed; z-index: 2; top: 0; right: 0; padding: 0; margin: 0; background-color: inherit; border-bottom: 1px solid #ccc; } #toc h2 { margin: -1px 0 0 0; padding: 4px 0 4px 6px; padding-right: 1em; min-width: 190px; font-size: 1.1em; text-align: right; background-color: #444; color: white; cursor: pointer; } #toc h2::before { /* css hamburger */ float: right; position: relative; width: 1em; height: 1px; left: -164px; margin: 6px 0 0 0; background: white none repeat scroll 0 0; box-shadow: 0 4px 0 0 white, 0 8px 0 0 white; content: ""; } #toc nav { display: none; padding: 0.5em 1em 1em; overflow: auto; height: calc(100vh - 48px); border-left: 1px solid #ddd; } } /* alternative layout for wide screens */ @media screen and (min-width: 1024px) { body { max-width: 724px; margin: 42px auto; padding-left: 1.5em; padding-right: 29em; } #toc { position: fixed; top: 42px; right: 42px; width: 25%; margin: 0; padding: 0 1em; z-index: 1; } #toc h2 { border-top: none; border-bottom: 1px solid #ddd; font-size: 1em; font-weight: normal; margin: 0; padding: 0.25em 1em 1em 0; } #toc nav { display: block; height: calc(90vh - 84px); bottom: 0; padding: 0.5em 0 0; overflow: auto; } img { /* future proofing */ max-width: 100%; height: auto; } } /* pagination */ @media print { body { width: 100%; } p { orphans: 3; widows: 3; } #n-copyright-notice { border-bottom: none; } #toc, #n-introduction { page-break-before: always; } #toc { border-top: none; padding-top: 0; } figure, pre { page-break-inside: avoid; } figure { overflow: scroll; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } h2+*, h3+*, h4+*, h5+*, h6+* { page-break-before: avoid; } pre { white-space: pre-wrap; word-wrap: break-word; font-size: 10pt; } table { border: 1px solid #ddd; } td { border-top: 1px solid #ddd; } } /* This is commented out here, as the string-set: doesn't pass W3C validation currently */ /* .ears thead .left { string-set: ears-top-left content(); } .ears thead .center { string-set: ears-top-center content(); } .ears thead .right { string-set: ears-top-right content(); } .ears tfoot .left { string-set: ears-bottom-left content(); } .ears tfoot .center { string-set: ears-bottom-center content(); } .ears tfoot .right { string-set: ears-bottom-right content(); } */ @page :first { padding-top: 0; @top-left { content: normal; border: none; } @top-center { content: normal; border: none; } @top-right { content: normal; border: none; } } @page { size: A4; margin-bottom: 45mm; padding-top: 20px; /* The follwing is commented out here, but set appropriately by in code, as the content depends on the document */ /* @top-left { content: 'Internet-Draft'; vertical-align: bottom; border-bottom: solid 1px #ccc; } @top-left { content: string(ears-top-left); vertical-align: bottom; border-bottom: solid 1px #ccc; } @top-center { content: string(ears-top-center); vertical-align: bottom; border-bottom: solid 1px #ccc; } @top-right { content: string(ears-top-right); vertical-align: bottom; border-bottom: solid 1px #ccc; } @bottom-left { content: string(ears-bottom-left); vertical-align: top; border-top: solid 1px #ccc; } @bottom-center { content: string(ears-bottom-center); vertical-align: top; border-top: solid 1px #ccc; } @bottom-right { content: '[Page ' counter(page) ']'; vertical-align: top; border-top: solid 1px #ccc; } */ } /* Changes introduced to fix issues found during implementation */ /* Make sure links are clickable even if overlapped by following H* */ a { z-index: 2; } /* Separate body from document info even without intervening H1 */ section { clear: both; } /* Top align author divs, to avoid names without organization dropping level with org names */ .author { vertical-align: top; } /* Leave room in document info to show Internet-Draft on one line */ #identifiers dt { width: 8em; } /* Don't waste quite as much whitespace between label and value in doc info */ #identifiers dd { margin-left: 1em; } /* Give floating toc a background color (needed when it's a div inside section */ #toc { background-color: white; } /* Make the collapsed ToC header render white on gray also when it's a link */ @media screen and (max-width: 1023px) { #toc h2 a, #toc h2 a:link, #toc h2 a:focus, #toc h2 a:hover, #toc a.toplink, #toc a.toplink:hover { color: white; background-color: #444; text-decoration: none; } } /* Give the bottom of the ToC some whitespace */ @media screen and (min-width: 1024px) { #toc { padding: 0 0 1em 1em; } } /* Style section numbers with more space between number and title */ .section-number { padding-right: 0.5em; } /* prevent monospace from becoming overly large */ tt, code, pre, code { font-size: 95%; } /* Fix the height/width aspect for ascii art*/ pre.sourcecode, .art-text pre { line-height: 1.12; } /* Add styling for a link in the ToC that points to the top of the document */ a.toplink { float: right; margin-right: 0.5em; } /* Fix the dl styling to match the RFC 7992 attributes */ dl > dt, dl.dlParallel > dt { float: left; margin-right: 1em; } dl.dlNewline > dt { float: none; } /* Provide styling for table cell text alignment */ table td.text-left, table th.text-left { text-align: left; } table td.text-center, table th.text-center { text-align: center; } table td.text-right, table th.text-right { text-align: right; } /* Make the alternative author contact informatio look less like just another author, and group it closer with the primary author contact information */ .alternative-contact { margin: 0.5em 0 0.25em 0; } address .non-ascii { margin: 0 0 0 2em; } /* With it being possible to set tables with alignment left, center, and right, { width: 100%; } does not make sense */ table { width: auto; } /* Avoid reference text that sits in a block with very wide left margin, because of a long floating dt label.*/ .references dd { overflow: visible; } /* Control caption placement */ caption { caption-side: bottom; } /* Limit the width of the author address vcard, so names in right-to-left script don't end up on the other side of the page. */ address.vcard { max-width: 30em; margin-right: auto; } /* For address alignment dependent on LTR or RTL scripts */ address div.left { text-align: left; } address div.right { text-align: right; } /* Provide table alignment support. We can't use the alignX classes above since they do unwanted things with caption and other styling. */ table.right { margin-left: auto; margin-right: 0; } table.center { margin-left: auto; margin-right: auto; } table.left { margin-left: 0; margin-right: auto; } /* Give the table caption label the same styling as the figcaption */ caption a[href] { color: #222; } @media print { .toplink { display: none; } /* avoid overwriting the top border line with the ToC header */ #toc { padding-top: 1px; } /* Avoid page breaks inside dl and author address entries */ .vcard { page-break-inside: avoid; } } /* Tweak the bcp14 keyword presentation */ .bcp14 { font-variant: small-caps; font-weight: bold; font-size: 0.9em; } /* Tweak the invisible space above H* in order not to overlay links in text above */ h2 { margin-top: -18px; /* provide offset for in-page anchors */ padding-top: 31px; } h3 { margin-top: -18px; /* provide offset for in-page anchors */ padding-top: 24px; } h4 { margin-top: -18px; /* provide offset for in-page anchors */ padding-top: 24px; } /* Float artwork pilcrow to the right */ @media screen { .artwork a.pilcrow { display: block; line-height: 0.7; margin-top: 0.15em; } } /* Make pilcrows on dd visible */ @media screen { dd:hover > a.pilcrow { visibility: visible; } } /* Make the placement of figcaption match that of a table's caption by removing the figure's added bottom margin */ .alignLeft.art-text, .alignCenter.art-text, .alignRight.art-text { margin-bottom: 0; } .alignLeft, .alignCenter, .alignRight { margin: 1em 0 0 0; } /* In print, the pilcrow won't show on hover, so prevent it from taking up space, possibly even requiring a new line */ @media print { a.pilcrow { display: none; } } /* Styling for the external metadata */ div#external-metadata { background-color: #eee; padding: 0.5em; margin-bottom: 0.5em; display: none; } div#internal-metadata { padding: 0.5em; /* to match the external-metadata padding */ } /* Styling for title RFC Number */ h1#rfcnum { clear: both; margin: 0 0 -1em; padding: 1em 0 0 0; } /* Make .olPercent look the same as <ol><li> */ dl.olPercent > dd { margin-bottom: 0.25em; min-height: initial; } /* Give aside some styling to set it apart */ aside { border-left: 1px solid #ddd; margin: 1em 0 1em 2em; padding: 0.2em 2em; } aside > dl, aside > ol, aside > ul, aside > table, aside > p { margin-bottom: 0.5em; } /* Additional page break settings */ @media print { figcaption, table caption { page-break-before: avoid; } } /* Font size adjustments for print */ @media print { body { font-size: 10pt; line-height: normal; max-width: 96%; } h1 { font-size: 1.72em; padding-top: 1.5em; } /* 1*1.2*1.2*1.2 */ h2 { font-size: 1.44em; padding-top: 1.5em; } /* 1*1.2*1.2 */ h3 { font-size: 1.2em; padding-top: 1.5em; } /* 1*1.2 */ h4 { font-size: 1em; padding-top: 1.5em; } h5, h6 { font-size: 1em; margin: initial; padding: 0.5em 0 0.3em; } } /* Sourcecode margin in print, when there's no pilcrow */ @media print { .artwork, .sourcecode { margin-bottom: 1em; } } /* Avoid narrow tables forcing too narrow table captions, which may render badly */ table { min-width: 20em; } /* ol type a */ ol.type-a { list-style-type: lower-alpha; } ol.type-A { list-style-type: upper-alpha; } ol.type-i { list-style-type: lower-roman; } ol.type-I { list-style-type: lower-roman; } /* Apply the print table and row borders in general, on request from the RPC, and increase the contrast between border and odd row background sligthtly */ table { border: 1px solid #ddd; } td { border-top: 1px solid #ddd; } tr:nth-child(2n+1) > td { background-color: #f8f8f8; } /* Use style rules to govern display of the TOC. */ @media screen and (max-width: 1023px) { #toc nav { display: none; } #toc.active nav { display: block; } } /* Add support for keepWithNext */ .keepWithNext { break-after: avoid-page; break-after: avoid-page; } /* Add support for keepWithPrevious */ .keepWithPrevious { break-before: avoid-page; } /* Change the approach to avoiding breaks inside artwork etc. */ figure, pre, table, .artwork, .sourcecode { break-before: avoid-page; break-after: auto; } /* Avoid breaks between <dt> and <dd> */ dl { break-before: auto; break-inside: auto; } dt { break-before: auto; break-after: avoid-page; } dd { break-before: avoid-page; break-after: auto; orphans: 3; widows: 3 } span.break, dd.break { margin-bottom: 0; min-height: 0; break-before: auto; break-inside: auto; break-after: auto; } /* Undo break-before ToC */ @media print { #toc { break-before: auto; } } /* Text in compact lists should not get extra bottim margin space, since that would makes the list not compact */ ul.compact p, .ulCompact p, ol.compact p, .olCompact p { margin: 0; } /* But the list as a whole needs the extra space at the end */ section ul.compact, section .ulCompact, section ol.compact, section .olCompact { margin-bottom: 1em; /* same as p not within ul.compact etc. */ } /* The tt and code background above interferes with for instance table cell backgrounds. Changed to something a bit more selective. */ tt, code { background-color: transparent; } p tt, p code, li tt, li code { background-color: #f8f8f8; } /* Tweak the pre margin -- 0px doesn't come out well */ pre { margin-top: 0.5px; } /* Tweak the comact list text */ ul.compact, .ulCompact, ol.compact, .olCompact, dl.compact, .dlCompact { line-height: normal; } /* Don't add top margin for nested lists */ li > ul, li > ol, li > dl, dd > ul, dd > ol, dd > dl, dl > dd > dl { margin-top: initial; } /* Elements that should not be rendered on the same line as a <dt> */ /* This should match the element list in writer.text.TextWriter.render_dl() */ dd > div.artwork:first-child, dd > aside:first-child, dd > figure:first-child, dd > ol:first-child, dd > div:first-child > pre.sourcecode, dd > table:first-child, dd > ul:first-child { clear: left; } /* fix for weird browser behaviour when <dd/> is empty */ dt+dd:empty::before{ content: "\00a0"; } </style> <link href="rfc-local.css" rel="stylesheet" type="text/css"> <link href="https://dx.doi.org/10.17487/rfc8941" rel="alternate"> <link href="urn:issn:2070-1721" rel="alternate"> <link href="https://datatracker.ietf.org/doc/draft-ietf-httpbis-header-structure-19" rel="prev"> </head> <body> <script src="https://www.rfc-editor.org/js/metadata.min.js"></script> <table class="ears"> <thead><tr> <td class="left">RFC 8941</td> <td class="center">Structured Field Values for HTTP</td> <td class="right">February 2021</td> </tr></thead> <tfoot><tr> <td class="left">Nottingham &amp; Kamp</td> <td class="center">Standards Track</td> <td class="right">[Page]</td> </tr></tfoot> </table> <div id="external-metadata" class="document-information"></div> <div id="internal-metadata" class="document-information"> <dl id="identifiers"> <dt class="label-stream">Stream:</dt> <dd class="stream">Internet Engineering Task Force (IETF)</dd> <dt class="label-rfc">RFC:</dt> <dd class="rfc"><a href="https://www.rfc-editor.org/rfc/rfc8941" class="eref">8941</a></dd> <dt class="label-category">Category:</dt> <dd class="category">Standards Track</dd> <dt class="label-published">Published:</dt> <dd class="published"> <time datetime="2021-02" class="published">February 2021</time> </dd> <dt class="label-issn">ISSN:</dt> <dd class="issn">2070-1721</dd> <dt class="label-authors">Authors:</dt> <dd class="authors"> <div class="author"> <div class="author-name">M. Nottingham</div> <div class="org">Fastly</div> </div> <div class="author"> <div class="author-name">P-H. Kamp</div> <div class="org">The Varnish Cache Project</div> </div> </dd> </dl> </div> <h1 id="rfcnum">RFC 8941</h1> <h1 id="title">Structured Field Values for HTTP</h1> <section id="section-abstract"> <h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2> <p id="section-abstract-1">This document describes a set of data types and associated algorithms that are intended to make it easier and safer to define and handle HTTP header and trailer fields, known as "Structured Fields", "Structured Headers", or "Structured Trailers". It is intended for use by specifications of new HTTP fields that wish to use a common syntax that is more restrictive than traditional HTTP field values.<a href="#section-abstract-1" class="pilcrow">¶</a></p> </section> <div id="status-of-memo"> <section id="section-boilerplate.1"> <h2 id="name-status-of-this-memo"> <a href="#name-status-of-this-memo" class="section-name selfRef">Status of This Memo</a> </h2> <p id="section-boilerplate.1-1"> This is an Internet Standards Track document.<a href="#section-boilerplate.1-1" class="pilcrow">¶</a></p> <p id="section-boilerplate.1-2"> This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.<a href="#section-boilerplate.1-2" class="pilcrow">¶</a></p> <p id="section-boilerplate.1-3"> Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at <span><a href="https://www.rfc-editor.org/info/rfc8941">https://www.rfc-editor.org/info/rfc8941</a></span>.<a href="#section-boilerplate.1-3" class="pilcrow">¶</a></p> </section> </div> <div id="copyright"> <section id="section-boilerplate.2"> <h2 id="name-copyright-notice"> <a href="#name-copyright-notice" class="section-name selfRef">Copyright Notice</a> </h2> <p id="section-boilerplate.2-1"> Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.<a href="#section-boilerplate.2-1" class="pilcrow">¶</a></p> <p id="section-boilerplate.2-2"> This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (<span><a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a></span>) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.<a href="#section-boilerplate.2-2" class="pilcrow">¶</a></p> </section> </div> <div id="toc"> <section id="section-toc.1"> <a href="#" onclick="scroll(0,0)" class="toplink">▲</a><h2 id="name-table-of-contents"> <a href="#name-table-of-contents" class="section-name selfRef">Table of Contents</a> </h2> <nav class="toc"><ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.1"> <p id="section-toc.1-1.1.1" class="keepWithNext"><a href="#section-1" class="xref">1</a>.  <a href="#name-introduction" class="xref">Introduction</a><a href="#section-toc.1-1.1.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.1.2.1"> <p id="section-toc.1-1.1.2.1.1" class="keepWithNext"><a href="#section-1.1" class="xref">1.1</a>.  <a href="#name-intentionally-strict-proces" class="xref">Intentionally Strict Processing</a><a href="#section-toc.1-1.1.2.1.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.1.2.2"> <p id="section-toc.1-1.1.2.2.1" class="keepWithNext"><a href="#section-1.2" class="xref">1.2</a>.  <a href="#name-notational-conventions" class="xref">Notational Conventions</a><a href="#section-toc.1-1.1.2.2.1" class="pilcrow">¶</a></p> </li> </ul> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.2"> <p id="section-toc.1-1.2.1"><a href="#section-2" class="xref">2</a>.  <a href="#name-defining-new-structured-fie" class="xref">Defining New Structured Fields</a><a href="#section-toc.1-1.2.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3"> <p id="section-toc.1-1.3.1"><a href="#section-3" class="xref">3</a>.  <a href="#name-structured-data-types" class="xref">Structured Data Types</a><a href="#section-toc.1-1.3.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.1"> <p id="section-toc.1-1.3.2.1.1"><a href="#section-3.1" class="xref">3.1</a>.  <a href="#name-lists" class="xref">Lists</a><a href="#section-toc.1-1.3.2.1.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.1.2.1"> <p id="section-toc.1-1.3.2.1.2.1.1"><a href="#section-3.1.1" class="xref">3.1.1</a>.  <a href="#name-inner-lists" class="xref">Inner Lists</a><a href="#section-toc.1-1.3.2.1.2.1.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.1.2.2"> <p id="section-toc.1-1.3.2.1.2.2.1"><a href="#section-3.1.2" class="xref">3.1.2</a>.  <a href="#name-parameters" class="xref">Parameters</a><a href="#section-toc.1-1.3.2.1.2.2.1" class="pilcrow">¶</a></p> </li> </ul> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.2"> <p id="section-toc.1-1.3.2.2.1"><a href="#section-3.2" class="xref">3.2</a>.  <a href="#name-dictionaries" class="xref">Dictionaries</a><a href="#section-toc.1-1.3.2.2.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3"> <p id="section-toc.1-1.3.2.3.1"><a href="#section-3.3" class="xref">3.3</a>.  <a href="#name-items" class="xref">Items</a><a href="#section-toc.1-1.3.2.3.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.1"> <p id="section-toc.1-1.3.2.3.2.1.1"><a href="#section-3.3.1" class="xref">3.3.1</a>.  <a href="#name-integers" class="xref">Integers</a><a href="#section-toc.1-1.3.2.3.2.1.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.2"> <p id="section-toc.1-1.3.2.3.2.2.1"><a href="#section-3.3.2" class="xref">3.3.2</a>.  <a href="#name-decimals" class="xref">Decimals</a><a href="#section-toc.1-1.3.2.3.2.2.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.3"> <p id="section-toc.1-1.3.2.3.2.3.1"><a href="#section-3.3.3" class="xref">3.3.3</a>.  <a href="#name-strings" class="xref">Strings</a><a href="#section-toc.1-1.3.2.3.2.3.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.4"> <p id="section-toc.1-1.3.2.3.2.4.1"><a href="#section-3.3.4" class="xref">3.3.4</a>.  <a href="#name-tokens" class="xref">Tokens</a><a href="#section-toc.1-1.3.2.3.2.4.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.5"> <p id="section-toc.1-1.3.2.3.2.5.1"><a href="#section-3.3.5" class="xref">3.3.5</a>.  <a href="#name-byte-sequences" class="xref">Byte Sequences</a><a href="#section-toc.1-1.3.2.3.2.5.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.6"> <p id="section-toc.1-1.3.2.3.2.6.1"><a href="#section-3.3.6" class="xref">3.3.6</a>.  <a href="#name-booleans" class="xref">Booleans</a><a href="#section-toc.1-1.3.2.3.2.6.1" class="pilcrow">¶</a></p> </li> </ul> </li> </ul> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4"> <p id="section-toc.1-1.4.1"><a href="#section-4" class="xref">4</a>.  <a href="#name-working-with-structured-fie" class="xref">Working with Structured Fields in HTTP</a><a href="#section-toc.1-1.4.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1"> <p id="section-toc.1-1.4.2.1.1"><a href="#section-4.1" class="xref">4.1</a>.  <a href="#name-serializing-structured-fiel" class="xref">Serializing Structured Fields</a><a href="#section-toc.1-1.4.2.1.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.1"> <p id="section-toc.1-1.4.2.1.2.1.1"><a href="#section-4.1.1" class="xref">4.1.1</a>.  <a href="#name-serializing-a-list" class="xref">Serializing a List</a><a href="#section-toc.1-1.4.2.1.2.1.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.2"> <p id="section-toc.1-1.4.2.1.2.2.1"><a href="#section-4.1.2" class="xref">4.1.2</a>.  <a href="#name-serializing-a-dictionary" class="xref">Serializing a Dictionary</a><a href="#section-toc.1-1.4.2.1.2.2.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.3"> <p id="section-toc.1-1.4.2.1.2.3.1"><a href="#section-4.1.3" class="xref">4.1.3</a>.  <a href="#name-serializing-an-item" class="xref">Serializing an Item</a><a href="#section-toc.1-1.4.2.1.2.3.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.4"> <p id="section-toc.1-1.4.2.1.2.4.1"><a href="#section-4.1.4" class="xref">4.1.4</a>.  <a href="#name-serializing-an-integer" class="xref">Serializing an Integer</a><a href="#section-toc.1-1.4.2.1.2.4.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.5"> <p id="section-toc.1-1.4.2.1.2.5.1"><a href="#section-4.1.5" class="xref">4.1.5</a>.  <a href="#name-serializing-a-decimal" class="xref">Serializing a Decimal</a><a href="#section-toc.1-1.4.2.1.2.5.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.6"> <p id="section-toc.1-1.4.2.1.2.6.1"><a href="#section-4.1.6" class="xref">4.1.6</a>.  <a href="#name-serializing-a-string" class="xref">Serializing a String</a><a href="#section-toc.1-1.4.2.1.2.6.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.7"> <p id="section-toc.1-1.4.2.1.2.7.1"><a href="#section-4.1.7" class="xref">4.1.7</a>.  <a href="#name-serializing-a-token" class="xref">Serializing a Token</a><a href="#section-toc.1-1.4.2.1.2.7.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.8"> <p id="section-toc.1-1.4.2.1.2.8.1"><a href="#section-4.1.8" class="xref">4.1.8</a>.  <a href="#name-serializing-a-byte-sequence" class="xref">Serializing a Byte Sequence</a><a href="#section-toc.1-1.4.2.1.2.8.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.1.2.9"> <p id="section-toc.1-1.4.2.1.2.9.1"><a href="#section-4.1.9" class="xref">4.1.9</a>.  <a href="#name-serializing-a-boolean" class="xref">Serializing a Boolean</a><a href="#section-toc.1-1.4.2.1.2.9.1" class="pilcrow">¶</a></p> </li> </ul> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2"> <p id="section-toc.1-1.4.2.2.1"><a href="#section-4.2" class="xref">4.2</a>.  <a href="#name-parsing-structured-fields" class="xref">Parsing Structured Fields</a><a href="#section-toc.1-1.4.2.2.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.1"> <p id="section-toc.1-1.4.2.2.2.1.1"><a href="#section-4.2.1" class="xref">4.2.1</a>.  <a href="#name-parsing-a-list" class="xref">Parsing a List</a><a href="#section-toc.1-1.4.2.2.2.1.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.2"> <p id="section-toc.1-1.4.2.2.2.2.1"><a href="#section-4.2.2" class="xref">4.2.2</a>.  <a href="#name-parsing-a-dictionary" class="xref">Parsing a Dictionary</a><a href="#section-toc.1-1.4.2.2.2.2.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.3"> <p id="section-toc.1-1.4.2.2.2.3.1"><a href="#section-4.2.3" class="xref">4.2.3</a>.  <a href="#name-parsing-an-item" class="xref">Parsing an Item</a><a href="#section-toc.1-1.4.2.2.2.3.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.4"> <p id="section-toc.1-1.4.2.2.2.4.1"><a href="#section-4.2.4" class="xref">4.2.4</a>.  <a href="#name-parsing-an-integer-or-decim" class="xref">Parsing an Integer or Decimal</a><a href="#section-toc.1-1.4.2.2.2.4.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.5"> <p id="section-toc.1-1.4.2.2.2.5.1"><a href="#section-4.2.5" class="xref">4.2.5</a>.  <a href="#name-parsing-a-string" class="xref">Parsing a String</a><a href="#section-toc.1-1.4.2.2.2.5.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.6"> <p id="section-toc.1-1.4.2.2.2.6.1"><a href="#section-4.2.6" class="xref">4.2.6</a>.  <a href="#name-parsing-a-token" class="xref">Parsing a Token</a><a href="#section-toc.1-1.4.2.2.2.6.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.7"> <p id="section-toc.1-1.4.2.2.2.7.1"><a href="#section-4.2.7" class="xref">4.2.7</a>.  <a href="#name-parsing-a-byte-sequence" class="xref">Parsing a Byte Sequence</a><a href="#section-toc.1-1.4.2.2.2.7.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.4.2.2.2.8"> <p id="section-toc.1-1.4.2.2.2.8.1"><a href="#section-4.2.8" class="xref">4.2.8</a>.  <a href="#name-parsing-a-boolean" class="xref">Parsing a Boolean</a><a href="#section-toc.1-1.4.2.2.2.8.1" class="pilcrow">¶</a></p> </li> </ul> </li> </ul> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.5"> <p id="section-toc.1-1.5.1"><a href="#section-5" class="xref">5</a>.  <a href="#name-iana-considerations" class="xref">IANA Considerations</a><a href="#section-toc.1-1.5.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.6"> <p id="section-toc.1-1.6.1"><a href="#section-6" class="xref">6</a>.  <a href="#name-security-considerations" class="xref">Security Considerations</a><a href="#section-toc.1-1.6.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.7"> <p id="section-toc.1-1.7.1"><a href="#section-7" class="xref">7</a>.  <a href="#name-references" class="xref">References</a><a href="#section-toc.1-1.7.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.7.2.1"> <p id="section-toc.1-1.7.2.1.1"><a href="#section-7.1" class="xref">7.1</a>.  <a href="#name-normative-references" class="xref">Normative References</a><a href="#section-toc.1-1.7.2.1.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.7.2.2"> <p id="section-toc.1-1.7.2.2.1"><a href="#section-7.2" class="xref">7.2</a>.  <a href="#name-informative-references" class="xref">Informative References</a><a href="#section-toc.1-1.7.2.2.1" class="pilcrow">¶</a></p> </li> </ul> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.8"> <p id="section-toc.1-1.8.1"><a href="#section-appendix.a" class="xref">Appendix A</a>.  <a href="#name-frequently-asked-questions" class="xref">Frequently Asked Questions</a><a href="#section-toc.1-1.8.1" class="pilcrow">¶</a></p> <ul class="compact toc ulEmpty"> <li class="compact toc ulEmpty" id="section-toc.1-1.8.2.1"> <p id="section-toc.1-1.8.2.1.1"><a href="#section-a.1" class="xref">A.1</a>.  <a href="#name-why-not-json" class="xref">Why Not JSON?</a><a href="#section-toc.1-1.8.2.1.1" class="pilcrow">¶</a></p> </li> </ul> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.9"> <p id="section-toc.1-1.9.1"><a href="#section-appendix.b" class="xref">Appendix B</a>.  <a href="#name-implementation-notes" class="xref">Implementation Notes</a><a href="#section-toc.1-1.9.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.10"> <p id="section-toc.1-1.10.1"><a href="#section-appendix.c" class="xref"></a><a href="#name-acknowledgements" class="xref">Acknowledgements</a><a href="#section-toc.1-1.10.1" class="pilcrow">¶</a></p> </li> <li class="compact toc ulEmpty" id="section-toc.1-1.11"> <p id="section-toc.1-1.11.1"><a href="#section-appendix.d" class="xref"></a><a href="#name-authors-addresses" class="xref">Authors' Addresses</a><a href="#section-toc.1-1.11.1" class="pilcrow">¶</a></p> </li> </ul> </nav> </section> </div> <div id="introduction"> <section id="section-1"> <h2 id="name-introduction"> <a href="#section-1" class="section-number selfRef">1. </a><a href="#name-introduction" class="section-name selfRef">Introduction</a> </h2> <p id="section-1-1">Specifying the syntax of new HTTP header (and trailer) fields is an onerous task; even with the guidance in <span><a href="https://www.rfc-editor.org/rfc/rfc7231#section-8.3.1" class="relref">Section 8.3.1</a> of [<a href="#RFC7231" class="xref">RFC7231</a>]</span>, there are many decisions -- and pitfalls -- for a prospective HTTP field author.<a href="#section-1-1" class="pilcrow">¶</a></p> <p id="section-1-2">Once a field is defined, bespoke parsers and serializers often need to be written, because each field value has a slightly different handling of what looks like common syntax.<a href="#section-1-2" class="pilcrow">¶</a></p> <p id="section-1-3">This document introduces a set of common data structures for use in definitions of new HTTP field values to address these problems. In particular, it defines a generic, abstract model for them, along with a concrete serialization for expressing that model in HTTP <span>[<a href="#RFC7230" class="xref">RFC7230</a>]</span> header and trailer fields.<a href="#section-1-3" class="pilcrow">¶</a></p> <p id="section-1-4">An HTTP field that is defined as a "Structured Header" or "Structured Trailer" (if the field can be either, it is a "Structured Field") uses the types defined in this specification to define its syntax and basic handling rules, thereby simplifying both its definition by specification writers and handling by implementations.<a href="#section-1-4" class="pilcrow">¶</a></p> <p id="section-1-5">Additionally, future versions of HTTP can define alternative serializations of the abstract model of these structures, allowing fields that use that model to be transmitted more efficiently without being redefined.<a href="#section-1-5" class="pilcrow">¶</a></p> <p id="section-1-6">Note that it is not a goal of this document to redefine the syntax of existing HTTP fields; the mechanisms described herein are only intended to be used with fields that explicitly opt into them.<a href="#section-1-6" class="pilcrow">¶</a></p> <p id="section-1-7"><a href="#specify" class="xref">Section 2</a> describes how to specify a Structured Field.<a href="#section-1-7" class="pilcrow">¶</a></p> <p id="section-1-8"><a href="#types" class="xref">Section 3</a> defines a number of abstract data types that can be used in Structured Fields.<a href="#section-1-8" class="pilcrow">¶</a></p> <p id="section-1-9">Those abstract types can be serialized into and parsed from HTTP field values using the algorithms described in <a href="#text" class="xref">Section 4</a>.<a href="#section-1-9" class="pilcrow">¶</a></p> <div id="strict"> <section id="section-1.1"> <h3 id="name-intentionally-strict-proces"> <a href="#section-1.1" class="section-number selfRef">1.1. </a><a href="#name-intentionally-strict-proces" class="section-name selfRef">Intentionally Strict Processing</a> </h3> <p id="section-1.1-1">This specification intentionally defines strict parsing and serialization behaviors using step-by-step algorithms; the only error handling defined is to fail the operation altogether.<a href="#section-1.1-1" class="pilcrow">¶</a></p> <p id="section-1.1-2">It is designed to encourage faithful implementation and good interoperability. Therefore, an implementation that tried to be helpful by being more tolerant of input would make interoperability worse, since that would create pressure on other implementations to implement similar (but likely subtly different) workarounds.<a href="#section-1.1-2" class="pilcrow">¶</a></p> <p id="section-1.1-3">In other words, strict processing is an intentional feature of this specification; it allows non-conformant input to be discovered and corrected by the producer early and avoids both interoperability and security issues that might otherwise result.<a href="#section-1.1-3" class="pilcrow">¶</a></p> <p id="section-1.1-4">Note that as a result of this strictness, if a field is appended to by multiple parties (e.g., intermediaries or different components in the sender), an error in one party's value is likely to cause the entire field value to fail parsing.<a href="#section-1.1-4" class="pilcrow">¶</a></p> </section> </div> <div id="notational-conventions"> <section id="section-1.2"> <h3 id="name-notational-conventions"> <a href="#section-1.2" class="section-number selfRef">1.2. </a><a href="#name-notational-conventions" class="section-name selfRef">Notational Conventions</a> </h3> <p id="section-1.2-1"> The key words "<span class="bcp14">MUST</span>", "<span class="bcp14">MUST NOT</span>", "<span class="bcp14">REQUIRED</span>", "<span class="bcp14">SHALL</span>", "<span class="bcp14">SHALL NOT</span>", "<span class="bcp14">SHOULD</span>", "<span class="bcp14">SHOULD NOT</span>", "<span class="bcp14">RECOMMENDED</span>", "<span class="bcp14">NOT RECOMMENDED</span>", "<span class="bcp14">MAY</span>", and "<span class="bcp14">OPTIONAL</span>" in this document are to be interpreted as described in BCP 14 <span>[<a href="#RFC2119" class="xref">RFC2119</a>]</span> <span>[<a href="#RFC8174" class="xref">RFC8174</a>]</span> when, and only when, they appear in all capitals, as shown here.<a href="#section-1.2-1" class="pilcrow">¶</a></p> <p id="section-1.2-2">This document uses algorithms to specify parsing and serialization behaviors and the Augmented Backus-Naur Form (ABNF) notation of <span>[<a href="#RFC5234" class="xref">RFC5234</a>]</span> to illustrate expected syntax in HTTP header fields. In doing so, it uses the VCHAR, SP, DIGIT, ALPHA, and DQUOTE rules from <span>[<a href="#RFC5234" class="xref">RFC5234</a>]</span>. It also includes the tchar and OWS rules from <span>[<a href="#RFC7230" class="xref">RFC7230</a>]</span>.<a href="#section-1.2-2" class="pilcrow">¶</a></p> <p id="section-1.2-3">When parsing from HTTP fields, implementations <span class="bcp14">MUST</span> have behavior that is indistinguishable from following the algorithms. If there is disagreement between the parsing algorithms and ABNF, the specified algorithms take precedence.<a href="#section-1.2-3" class="pilcrow">¶</a></p> <p id="section-1.2-4">For serialization to HTTP fields, the ABNF illustrates their expected wire representations, and the algorithms define the recommended way to produce them. Implementations <span class="bcp14">MAY</span> vary from the specified behavior so long as the output is still correctly handled by the parsing algorithm described in <a href="#text-parse" class="xref">Section 4.2</a>.<a href="#section-1.2-4" class="pilcrow">¶</a></p> </section> </div> </section> </div> <div id="specify"> <section id="section-2"> <h2 id="name-defining-new-structured-fie"> <a href="#section-2" class="section-number selfRef">2. </a><a href="#name-defining-new-structured-fie" class="section-name selfRef">Defining New Structured Fields</a> </h2> <p id="section-2-1">To specify an HTTP field as a Structured Field, its authors need to:<a href="#section-2-1" class="pilcrow">¶</a></p> <ul class="normal"> <li class="normal" id="section-2-2.1">Normatively reference this specification. Recipients and generators of the field need to know that the requirements of this document are in effect.<a href="#section-2-2.1" class="pilcrow">¶</a> </li> <li class="normal" id="section-2-2.2">Identify whether the field is a Structured Header (i.e., it can only be used in the header section -- the common case), a Structured Trailer (only in the trailer section), or a Structured Field (both).<a href="#section-2-2.2" class="pilcrow">¶</a> </li> <li class="normal" id="section-2-2.3">Specify the type of the field value; either List (<a href="#list" class="xref">Section 3.1</a>), Dictionary (<a href="#dictionary" class="xref">Section 3.2</a>), or Item (<a href="#item" class="xref">Section 3.3</a>).<a href="#section-2-2.3" class="pilcrow">¶</a> </li> <li class="normal" id="section-2-2.4">Define the semantics of the field value.<a href="#section-2-2.4" class="pilcrow">¶</a> </li> <li class="normal" id="section-2-2.5">Specify any additional constraints upon the field value, as well as the consequences when those constraints are violated.<a href="#section-2-2.5" class="pilcrow">¶</a> </li> </ul> <p id="section-2-3">Typically, this means that a field definition will specify the top-level type -- List, Dictionary, or Item -- and then define its allowable types and constraints upon them. For example, a header defined as a List might have all Integer members, or a mix of types; a header defined as an Item might allow only Strings, and additionally only strings beginning with the letter "Q", or strings in lowercase. Likewise, Inner Lists (<a href="#inner-list" class="xref">Section 3.1.1</a>) are only valid when a field definition explicitly allows them.<a href="#section-2-3" class="pilcrow">¶</a></p> <p id="section-2-4">When parsing fails, the entire field is ignored (see <a href="#text-parse" class="xref">Section 4.2</a>); in most situations, violating field-specific constraints should have the same effect. Thus, if a header is defined as an Item and required to be an Integer, but a String is received, the field will by default be ignored. If the field requires different error handling, this should be explicitly specified.<a href="#section-2-4" class="pilcrow">¶</a></p> <p id="section-2-5">Both Items and Inner Lists allow parameters as an extensibility mechanism; this means that values can later be extended to accommodate more information, if need be. To preserve forward compatibility, field specifications are discouraged from defining the presence of an unrecognized parameter as an error condition.<a href="#section-2-5" class="pilcrow">¶</a></p> <p id="section-2-6">To further assure that this extensibility is available in the future, and to encourage consumers to use a complete parser implementation, a field definition can specify that "grease" parameters be added by senders. A specification could stipulate that all parameters that fit a defined pattern are reserved for this use and then encourage them to be sent on some portion of requests. This helps to discourage recipients from writing a parser that does not account for Parameters.<a href="#section-2-6" class="pilcrow">¶</a></p> <p id="section-2-7">Specifications that use Dictionaries can also allow for forward compatibility by requiring that the presence of -- as well as value and type associated with -- unknown members be ignored. Subsequent specifications can then add additional members, specifying constraints on them as appropriate.<a href="#section-2-7" class="pilcrow">¶</a></p> <p id="section-2-8">An extension to a Structured Field can then require that an entire field value be ignored by a recipient that understands the extension if constraints on the value it defines are not met.<a href="#section-2-8" class="pilcrow">¶</a></p> <p id="section-2-9">A field definition cannot relax the requirements of this specification because doing so would preclude handling by generic software; they can only add additional constraints (for example, on the numeric range of Integers and Decimals, the format of Strings and Tokens, the types allowed in a Dictionary's values, or the number of Items in a List). Likewise, field definitions can only use this specification for the entire field value, not a portion thereof.<a href="#section-2-9" class="pilcrow">¶</a></p> <p id="section-2-10">This specification defines minimums for the length or number of various structures supported by implementations. It does not specify maximum sizes in most cases, but authors should be aware that HTTP implementations do impose various limits on the size of individual fields, the total number of fields, and/or the size of the entire header or trailer section.<a href="#section-2-10" class="pilcrow">¶</a></p> <p id="section-2-11">Specifications can refer to a field name as a "structured header name", "structured trailer name", or "structured field name" as appropriate. Likewise, they can refer its field value as a "structured header value", "structured trailer value", or "structured field value" as necessary. Field definitions are encouraged to use the ABNF rules beginning with "sf-" defined in this specification; other rules in this specification are not intended to be used in field definitions.<a href="#section-2-11" class="pilcrow">¶</a></p> <p id="section-2-12">For example, a fictitious Foo-Example header field might be specified as:<a href="#section-2-12" class="pilcrow">¶</a></p> <blockquote id="section-2-13"> <p id="section-2-13.1">42. Foo-Example Header<a href="#section-2-13.1" class="pilcrow">¶</a></p> <p id="section-2-13.2">The Foo-Example HTTP header field conveys information about how much Foo the message has.<a href="#section-2-13.2" class="pilcrow">¶</a></p> <p id="section-2-13.3">Foo-Example is an Item Structured Header [RFC8941]. Its value MUST be an Integer (Section 3.3.1 of [RFC8941]). Its ABNF is:<a href="#section-2-13.3" class="pilcrow">¶</a></p> <div class="artwork art-text alignLeft" id="section-2-13.4"> <pre> Foo-Example = sf-integer </pre><a href="#section-2-13.4" class="pilcrow">¶</a> </div> <p id="section-2-13.5">Its value indicates the amount of Foo in the message, and it MUST be between 0 and 10, inclusive; other values MUST cause the entire header field to be ignored.<a href="#section-2-13.5" class="pilcrow">¶</a></p> <p id="section-2-13.6">The following parameter is defined:<a href="#section-2-13.6" class="pilcrow">¶</a></p> <ul class="normal"> <li class="normal" id="section-2-13.7.1">A parameter whose key is "foourl", and whose value is a String (Section 3.3.3 of [RFC8941]), conveying the Foo URL for the message. See below for processing requirements.<a href="#section-2-13.7.1" class="pilcrow">¶</a> </li> </ul> <p id="section-2-13.8">"foourl" contains a URI-reference (Section 4.1 of [RFC3986]). If its value is not a valid URI-reference, the entire header field MUST be ignored. If its value is a relative reference (Section 4.2 of [RFC3986]), it MUST be resolved (Section 5 of [RFC3986]) before being used.<a href="#section-2-13.8" class="pilcrow">¶</a></p> <p id="section-2-13.9">For example:<a href="#section-2-13.9" class="pilcrow">¶</a></p> <div class="artwork art-text alignLeft" id="section-2-13.10"> <pre> Foo-Example: 2; foourl="https://foo.example.com/" </pre><a href="#section-2-13.10" class="pilcrow">¶</a> </div> </blockquote> </section> </div> <div id="types"> <section id="section-3"> <h2 id="name-structured-data-types"> <a href="#section-3" class="section-number selfRef">3. </a><a href="#name-structured-data-types" class="section-name selfRef">Structured Data Types</a> </h2> <p id="section-3-1">This section defines the abstract types for Structured Fields. The ABNF provided represents the on-wire format in HTTP field values.<a href="#section-3-1" class="pilcrow">¶</a></p> <p id="section-3-2">In summary:<a href="#section-3-2" class="pilcrow">¶</a></p> <ul class="normal"> <li class="normal" id="section-3-3.1">There are three top-level types that an HTTP field can be defined as: Lists, Dictionaries, and Items.<a href="#section-3-3.1" class="pilcrow">¶</a> </li> <li class="normal" id="section-3-3.2">Lists and Dictionaries are containers; their members can be Items or Inner Lists (which are themselves arrays of Items).<a href="#section-3-3.2" class="pilcrow">¶</a> </li> <li class="normal" id="section-3-3.3">Both Items and Inner Lists can be Parameterized with key/value pairs.<a href="#section-3-3.3" class="pilcrow">¶</a> </li> </ul> <div id="list"> <section id="section-3.1"> <h3 id="name-lists"> <a href="#section-3.1" class="section-number selfRef">3.1. </a><a href="#name-lists" class="section-name selfRef">Lists</a> </h3> <p id="section-3.1-1">Lists are arrays of zero or more members, each of which can be an Item (<a href="#item" class="xref">Section 3.3</a>) or an Inner List (<a href="#inner-list" class="xref">Section 3.1.1</a>), both of which can be Parameterized (<a href="#param" class="xref">Section 3.1.2</a>).<a href="#section-3.1-1" class="pilcrow">¶</a></p> <p id="section-3.1-2">The ABNF for Lists in HTTP fields is:<a href="#section-3.1-2" class="pilcrow">¶</a></p> <div id="section-3.1-3"> <pre class="sourcecode lang-abnf"> sf-list = list-member *( OWS "," OWS list-member ) list-member = sf-item / inner-list </pre><a href="#section-3.1-3" class="pilcrow">¶</a> </div> <p id="section-3.1-4">Each member is separated by a comma and optional whitespace. For example, a field whose value is defined as a List of Tokens could look like:<a href="#section-3.1-4" class="pilcrow">¶</a></p> <div id="section-3.1-5"> <pre class="sourcecode lang-http-message"> Example-List: sugar, tea, rum </pre><a href="#section-3.1-5" class="pilcrow">¶</a> </div> <p id="section-3.1-6">An empty List is denoted by not serializing the field at all. This implies that fields defined as Lists have a default empty value.<a href="#section-3.1-6" class="pilcrow">¶</a></p> <p id="section-3.1-7">Note that Lists can have their members split across multiple lines of the same header or trailer section, as per <span><a href="https://www.rfc-editor.org/rfc/rfc7230#section-3.2.2" class="relref">Section 3.2.2</a> of [<a href="#RFC7230" class="xref">RFC7230</a>]</span>; for example, the following are equivalent:<a href="#section-3.1-7" class="pilcrow">¶</a></p> <div id="section-3.1-8"> <pre class="sourcecode lang-http-message"> Example-List: sugar, tea, rum </pre><a href="#section-3.1-8" class="pilcrow">¶</a> </div> <p id="section-3.1-9">and<a href="#section-3.1-9" class="pilcrow">¶</a></p> <div id="section-3.1-10"> <pre class="sourcecode lang-http-message"> Example-List: sugar, tea Example-List: rum </pre><a href="#section-3.1-10" class="pilcrow">¶</a> </div> <p id="section-3.1-11">However, individual members of a List cannot be safely split between lines; see <a href="#text-parse" class="xref">Section 4.2</a> for details.<a href="#section-3.1-11" class="pilcrow">¶</a></p> <p id="section-3.1-12">Parsers <span class="bcp14">MUST</span> support Lists containing at least 1024 members. Field specifications can constrain the types and cardinality of individual List values as they require.<a href="#section-3.1-12" class="pilcrow">¶</a></p> <div id="inner-list"> <section id="section-3.1.1"> <h4 id="name-inner-lists"> <a href="#section-3.1.1" class="section-number selfRef">3.1.1. </a><a href="#name-inner-lists" class="section-name selfRef">Inner Lists</a> </h4> <p id="section-3.1.1-1">An Inner List is an array of zero or more Items (<a href="#item" class="xref">Section 3.3</a>). Both the individual Items and the Inner List itself can be Parameterized (<a href="#param" class="xref">Section 3.1.2</a>).<a href="#section-3.1.1-1" class="pilcrow">¶</a></p> <p id="section-3.1.1-2">The ABNF for Inner Lists is:<a href="#section-3.1.1-2" class="pilcrow">¶</a></p> <div id="section-3.1.1-3"> <pre class="sourcecode lang-abnf"> inner-list = "(" *SP [ sf-item *( 1*SP sf-item ) *SP ] ")" parameters </pre><a href="#section-3.1.1-3" class="pilcrow">¶</a> </div> <p id="section-3.1.1-4">Inner Lists are denoted by surrounding parenthesis, and their values are delimited by one or more spaces. A field whose value is defined as a List of Inner Lists of Strings could look like:<a href="#section-3.1.1-4" class="pilcrow">¶</a></p> <div id="section-3.1.1-5"> <pre class="sourcecode lang-http-message"> Example-List: ("foo" "bar"), ("baz"), ("bat" "one"), () </pre><a href="#section-3.1.1-5" class="pilcrow">¶</a> </div> <p id="section-3.1.1-6">Note that the last member in this example is an empty Inner List.<a href="#section-3.1.1-6" class="pilcrow">¶</a></p> <p id="section-3.1.1-7">A header field whose value is defined as a List of Inner Lists with Parameters at both levels could look like:<a href="#section-3.1.1-7" class="pilcrow">¶</a></p> <div id="section-3.1.1-8"> <pre class="sourcecode lang-http-message"> Example-List: ("foo"; a=1;b=2);lvl=5, ("bar" "baz");lvl=1 </pre><a href="#section-3.1.1-8" class="pilcrow">¶</a> </div> <p id="section-3.1.1-9">Parsers <span class="bcp14">MUST</span> support Inner Lists containing at least 256 members. Field specifications can constrain the types and cardinality of individual Inner List members as they require.<a href="#section-3.1.1-9" class="pilcrow">¶</a></p> </section> </div> <div id="param"> <section id="section-3.1.2"> <h4 id="name-parameters"> <a href="#section-3.1.2" class="section-number selfRef">3.1.2. </a><a href="#name-parameters" class="section-name selfRef">Parameters</a> </h4> <p id="section-3.1.2-1">Parameters are an ordered map of key-value pairs that are associated with an Item (<a href="#item" class="xref">Section 3.3</a>) or Inner List (<a href="#inner-list" class="xref">Section 3.1.1</a>). The keys are unique within the scope of the Parameters they occur within, and the values are bare items (i.e., they themselves cannot be parameterized; see <a href="#item" class="xref">Section 3.3</a>).<a href="#section-3.1.2-1" class="pilcrow">¶</a></p> <p id="section-3.1.2-2">Implementations <span class="bcp14">MUST</span> provide access to Parameters both by index and by key. Specifications <span class="bcp14">MAY</span> use either means of accessing them.<a href="#section-3.1.2-2" class="pilcrow">¶</a></p> <p id="section-3.1.2-3">The ABNF for Parameters is:<a href="#section-3.1.2-3" class="pilcrow">¶</a></p> <div id="section-3.1.2-4"> <pre class="sourcecode lang-abnf"> parameters = *( ";" *SP parameter ) parameter = param-key [ "=" param-value ] param-key = key key = ( lcalpha / "*" ) *( lcalpha / DIGIT / "_" / "-" / "." / "*" ) lcalpha = %x61-7A ; a-z param-value = bare-item </pre><a href="#section-3.1.2-4" class="pilcrow">¶</a> </div> <p id="section-3.1.2-5">Note that parameters are ordered as serialized, and parameter keys cannot contain uppercase letters. A parameter is separated from its Item or Inner List and other parameters by a semicolon. For example:<a href="#section-3.1.2-5" class="pilcrow">¶</a></p> <div id="section-3.1.2-6"> <pre class="sourcecode lang-http-message"> Example-List: abc;a=1;b=2; cde_456, (ghi;jk=4 l);q="9";r=w </pre><a href="#section-3.1.2-6" class="pilcrow">¶</a> </div> <p id="section-3.1.2-7">Parameters whose value is Boolean (see <a href="#boolean" class="xref">Section 3.3.6</a>) true <span class="bcp14">MUST</span> omit that value when serialized. For example, the "a" parameter here is true, while the "b" parameter is false:<a href="#section-3.1.2-7" class="pilcrow">¶</a></p> <div id="section-3.1.2-8"> <pre class="sourcecode lang-http-message"> Example-Integer: 1; a; b=?0 </pre><a href="#section-3.1.2-8" class="pilcrow">¶</a> </div> <p id="section-3.1.2-9">Note that this requirement is only on serialization; parsers are still required to correctly handle the true value when it appears in a parameter.<a href="#section-3.1.2-9" class="pilcrow">¶</a></p> <p id="section-3.1.2-10">Parsers <span class="bcp14">MUST</span> support at least 256 parameters on an Item or Inner List, and support parameter keys with at least 64 characters. Field specifications can constrain the order of individual parameters, as well as their values' types as required.<a href="#section-3.1.2-10" class="pilcrow">¶</a></p> </section> </div> </section> </div> <div id="dictionary"> <section id="section-3.2"> <h3 id="name-dictionaries"> <a href="#section-3.2" class="section-number selfRef">3.2. </a><a href="#name-dictionaries" class="section-name selfRef">Dictionaries</a> </h3> <p id="section-3.2-1">Dictionaries are ordered maps of key-value pairs, where the keys are short textual strings and the values are Items (<a href="#item" class="xref">Section 3.3</a>) or arrays of Items, both of which can be Parameterized (<a href="#param" class="xref">Section 3.1.2</a>). There can be zero or more members, and their keys are unique in the scope of the Dictionary they occur within.<a href="#section-3.2-1" class="pilcrow">¶</a></p> <p id="section-3.2-2">Implementations <span class="bcp14">MUST</span> provide access to Dictionaries both by index and by key. Specifications <span class="bcp14">MAY</span> use either means of accessing the members.<a href="#section-3.2-2" class="pilcrow">¶</a></p> <p id="section-3.2-3">The ABNF for Dictionaries is:<a href="#section-3.2-3" class="pilcrow">¶</a></p> <div id="section-3.2-4"> <pre class="sourcecode lang-abnf"> sf-dictionary = dict-member *( OWS "," OWS dict-member ) dict-member = member-key ( parameters / ( "=" member-value )) member-key = key member-value = sf-item / inner-list </pre><a href="#section-3.2-4" class="pilcrow">¶</a> </div> <p id="section-3.2-5">Members are ordered as serialized and separated by a comma with optional whitespace. Member keys cannot contain uppercase characters. Keys and values are separated by "=" (without whitespace). For example:<a href="#section-3.2-5" class="pilcrow">¶</a></p> <div id="section-3.2-6"> <pre class="sourcecode lang-http-message"> Example-Dict: en="Applepie", da=:w4ZibGV0w6ZydGU=: </pre><a href="#section-3.2-6" class="pilcrow">¶</a> </div> <p id="section-3.2-7">Note that in this example, the final "=" is due to the inclusion of a Byte Sequence; see <a href="#binary" class="xref">Section 3.3.5</a>.<a href="#section-3.2-7" class="pilcrow">¶</a></p> <p id="section-3.2-8">Members whose value is Boolean (see <a href="#boolean" class="xref">Section 3.3.6</a>) true <span class="bcp14">MUST</span> omit that value when serialized. For example, here both "b" and "c" are true:<a href="#section-3.2-8" class="pilcrow">¶</a></p> <div id="section-3.2-9"> <pre class="sourcecode lang-http-message"> Example-Dict: a=?0, b, c; foo=bar </pre><a href="#section-3.2-9" class="pilcrow">¶</a> </div> <p id="section-3.2-10">Note that this requirement is only on serialization; parsers are still required to correctly handle the true Boolean value when it appears in Dictionary values.<a href="#section-3.2-10" class="pilcrow">¶</a></p> <p id="section-3.2-11">A Dictionary with a member whose value is an Inner List of Tokens:<a href="#section-3.2-11" class="pilcrow">¶</a></p> <div id="section-3.2-12"> <pre class="sourcecode lang-http-message"> Example-Dict: rating=1.5, feelings=(joy sadness) </pre><a href="#section-3.2-12" class="pilcrow">¶</a> </div> <p id="section-3.2-13">A Dictionary with a mix of Items and Inner Lists, some with parameters:<a href="#section-3.2-13" class="pilcrow">¶</a></p> <div id="section-3.2-14"> <pre class="sourcecode lang-http-message"> Example-Dict: a=(1 2), b=3, c=4;aa=bb, d=(5 6);valid </pre><a href="#section-3.2-14" class="pilcrow">¶</a> </div> <p id="section-3.2-15">As with Lists, an empty Dictionary is represented by omitting the entire field. This implies that fields defined as Dictionaries have a default empty value.<a href="#section-3.2-15" class="pilcrow">¶</a></p> <p id="section-3.2-16">Typically, a field specification will define the semantics of Dictionaries by specifying the allowed type(s) for individual members by their keys, as well as whether their presence is required or optional. Recipients <span class="bcp14">MUST</span> ignore members whose keys that are undefined or unknown, unless the field's specification specifically disallows them.<a href="#section-3.2-16" class="pilcrow">¶</a></p> <p id="section-3.2-17">Note that Dictionaries can have their members split across multiple lines of the same header or trailer section; for example, the following are equivalent:<a href="#section-3.2-17" class="pilcrow">¶</a></p> <div id="section-3.2-18"> <pre class="sourcecode lang-http-message"> Example-Dict: foo=1, bar=2 </pre><a href="#section-3.2-18" class="pilcrow">¶</a> </div> <p id="section-3.2-19">and<a href="#section-3.2-19" class="pilcrow">¶</a></p> <div id="section-3.2-20"> <pre class="sourcecode lang-http-message"> Example-Dict: foo=1 Example-Dict: bar=2 </pre><a href="#section-3.2-20" class="pilcrow">¶</a> </div> <p id="section-3.2-21">However, individual members of a Dictionary cannot be safely split between lines; see <a href="#text-parse" class="xref">Section 4.2</a> for details.<a href="#section-3.2-21" class="pilcrow">¶</a></p> <p id="section-3.2-22">Parsers <span class="bcp14">MUST</span> support Dictionaries containing at least 1024 key/value pairs and keys with at least 64 characters. Field specifications can constrain the order of individual Dictionary members, as well as their values' types as required.<a href="#section-3.2-22" class="pilcrow">¶</a></p> </section> </div> <div id="item"> <section id="section-3.3"> <h3 id="name-items"> <a href="#section-3.3" class="section-number selfRef">3.3. </a><a href="#name-items" class="section-name selfRef">Items</a> </h3> <p id="section-3.3-1">An Item can be an Integer (<a href="#integer" class="xref">Section 3.3.1</a>), a Decimal (<a href="#decimal" class="xref">Section 3.3.2</a>), a String (<a href="#string" class="xref">Section 3.3.3</a>), a Token (<a href="#token" class="xref">Section 3.3.4</a>), a Byte Sequence (<a href="#binary" class="xref">Section 3.3.5</a>), or a Boolean (<a href="#boolean" class="xref">Section 3.3.6</a>). It can have associated parameters (<a href="#param" class="xref">Section 3.1.2</a>).<a href="#section-3.3-1" class="pilcrow">¶</a></p> <p id="section-3.3-2">The ABNF for Items is:<a href="#section-3.3-2" class="pilcrow">¶</a></p> <div id="section-3.3-3"> <pre class="sourcecode lang-abnf"> sf-item = bare-item parameters bare-item = sf-integer / sf-decimal / sf-string / sf-token / sf-binary / sf-boolean </pre><a href="#section-3.3-3" class="pilcrow">¶</a> </div> <p id="section-3.3-4">For example, a header field that is defined to be an Item that is an Integer might look like:<a href="#section-3.3-4" class="pilcrow">¶</a></p> <div id="section-3.3-5"> <pre class="sourcecode lang-http-message"> Example-Integer: 5 </pre><a href="#section-3.3-5" class="pilcrow">¶</a> </div> <p id="section-3.3-6">or with parameters:<a href="#section-3.3-6" class="pilcrow">¶</a></p> <div id="section-3.3-7"> <pre class="sourcecode lang-http-message"> Example-Integer: 5; foo=bar </pre><a href="#section-3.3-7" class="pilcrow">¶</a> </div> <div id="integer"> <section id="section-3.3.1"> <h4 id="name-integers"> <a href="#section-3.3.1" class="section-number selfRef">3.3.1. </a><a href="#name-integers" class="section-name selfRef">Integers</a> </h4> <p id="section-3.3.1-1">Integers have a range of -999,999,999,999,999 to 999,999,999,999,999 inclusive (i.e., up to fifteen digits, signed), for IEEE 754 compatibility <span>[<a href="#IEEE754" class="xref">IEEE754</a>]</span>.<a href="#section-3.3.1-1" class="pilcrow">¶</a></p> <p id="section-3.3.1-2">The ABNF for Integers is:<a href="#section-3.3.1-2" class="pilcrow">¶</a></p> <div id="section-3.3.1-3"> <pre class="sourcecode lang-abnf"> sf-integer = ["-"] 1*15DIGIT </pre><a href="#section-3.3.1-3" class="pilcrow">¶</a> </div> <p id="section-3.3.1-4">For example:<a href="#section-3.3.1-4" class="pilcrow">¶</a></p> <div id="section-3.3.1-5"> <pre class="sourcecode lang-http-message"> Example-Integer: 42 </pre><a href="#section-3.3.1-5" class="pilcrow">¶</a> </div> <p id="section-3.3.1-6">Integers larger than 15 digits can be supported in a variety of ways; for example, by using a String (<a href="#string" class="xref">Section 3.3.3</a>), a Byte Sequence (<a href="#binary" class="xref">Section 3.3.5</a>), or a parameter on an Integer that acts as a scaling factor.<a href="#section-3.3.1-6" class="pilcrow">¶</a></p> <p id="section-3.3.1-7">While it is possible to serialize Integers with leading zeros (e.g., "0002", "-01") and signed zero ("-0"), these distinctions may not be preserved by implementations.<a href="#section-3.3.1-7" class="pilcrow">¶</a></p> <p id="section-3.3.1-8">Note that commas in Integers are used in this section's prose only for readability; they are not valid in the wire format.<a href="#section-3.3.1-8" class="pilcrow">¶</a></p> </section> </div> <div id="decimal"> <section id="section-3.3.2"> <h4 id="name-decimals"> <a href="#section-3.3.2" class="section-number selfRef">3.3.2. </a><a href="#name-decimals" class="section-name selfRef">Decimals</a> </h4> <p id="section-3.3.2-1">Decimals are numbers with an integer and a fractional component. The integer component has at most 12 digits; the fractional component has at most three digits.<a href="#section-3.3.2-1" class="pilcrow">¶</a></p> <p id="section-3.3.2-2">The ABNF for decimals is:<a href="#section-3.3.2-2" class="pilcrow">¶</a></p> <div id="section-3.3.2-3"> <pre class="sourcecode lang-abnf"> sf-decimal = ["-"] 1*12DIGIT "." 1*3DIGIT </pre><a href="#section-3.3.2-3" class="pilcrow">¶</a> </div> <p id="section-3.3.2-4">For example, a header whose value is defined as a Decimal could look like:<a href="#section-3.3.2-4" class="pilcrow">¶</a></p> <div id="section-3.3.2-5"> <pre class="sourcecode lang-http-message"> Example-Decimal: 4.5 </pre><a href="#section-3.3.2-5" class="pilcrow">¶</a> </div> <p id="section-3.3.2-6">While it is possible to serialize Decimals with leading zeros (e.g., "0002.5", "-01.334"), trailing zeros (e.g., "5.230", "-0.40"), and signed zero (e.g., "-0.0"), these distinctions may not be preserved by implementations.<a href="#section-3.3.2-6" class="pilcrow">¶</a></p> <p id="section-3.3.2-7">Note that the serialization algorithm (<a href="#ser-decimal" class="xref">Section 4.1.5</a>) rounds input with more than three digits of precision in the fractional component. If an alternative rounding strategy is desired, this should be specified by the header definition to occur before serialization.<a href="#section-3.3.2-7" class="pilcrow">¶</a></p> </section> </div> <div id="string"> <section id="section-3.3.3"> <h4 id="name-strings"> <a href="#section-3.3.3" class="section-number selfRef">3.3.3. </a><a href="#name-strings" class="section-name selfRef">Strings</a> </h4> <p id="section-3.3.3-1">Strings are zero or more printable ASCII <span>[<a href="#RFC0020" class="xref">RFC0020</a>]</span> characters (i.e., the range %x20 to %x7E). Note that this excludes tabs, newlines, carriage returns, etc.<a href="#section-3.3.3-1" class="pilcrow">¶</a></p> <p id="section-3.3.3-2">The ABNF for Strings is:<a href="#section-3.3.3-2" class="pilcrow">¶</a></p> <div id="section-3.3.3-3"> <pre class="sourcecode lang-abnf"> sf-string = DQUOTE *chr DQUOTE chr = unescaped / escaped unescaped = %x20-21 / %x23-5B / %x5D-7E escaped = "\" ( DQUOTE / "\" ) </pre><a href="#section-3.3.3-3" class="pilcrow">¶</a> </div> <p id="section-3.3.3-4">Strings are delimited with double quotes, using a backslash ("\") to escape double quotes and backslashes. For example:<a href="#section-3.3.3-4" class="pilcrow">¶</a></p> <div id="section-3.3.3-5"> <pre class="sourcecode lang-http-message"> Example-String: "hello world" </pre><a href="#section-3.3.3-5" class="pilcrow">¶</a> </div> <p id="section-3.3.3-6">Note that Strings only use DQUOTE as a delimiter; single quotes do not delimit Strings. Furthermore, only DQUOTE and "\" can be escaped; other characters after "\" <span class="bcp14">MUST</span> cause parsing to fail.<a href="#section-3.3.3-6" class="pilcrow">¶</a></p> <p id="section-3.3.3-7">Unicode is not directly supported in Strings, because it causes a number of interoperability issues, and -- with few exceptions -- field values do not require it.<a href="#section-3.3.3-7" class="pilcrow">¶</a></p> <p id="section-3.3.3-8">When it is necessary for a field value to convey non-ASCII content, a Byte Sequence (<a href="#binary" class="xref">Section 3.3.5</a>) can be specified, along with a character encoding (preferably UTF-8 <span>[<a href="#STD63" class="xref">STD63</a>]</span>).<a href="#section-3.3.3-8" class="pilcrow">¶</a></p> <p id="section-3.3.3-9">Parsers <span class="bcp14">MUST</span> support Strings (after any decoding) with at least 1024 characters.<a href="#section-3.3.3-9" class="pilcrow">¶</a></p> </section> </div> <div id="token"> <section id="section-3.3.4"> <h4 id="name-tokens"> <a href="#section-3.3.4" class="section-number selfRef">3.3.4. </a><a href="#name-tokens" class="section-name selfRef">Tokens</a> </h4> <p id="section-3.3.4-1">Tokens are short textual words; their abstract model is identical to their expression in the HTTP field value serialization.<a href="#section-3.3.4-1" class="pilcrow">¶</a></p> <p id="section-3.3.4-2">The ABNF for Tokens is:<a href="#section-3.3.4-2" class="pilcrow">¶</a></p> <div id="section-3.3.4-3"> <pre class="sourcecode lang-abnf"> sf-token = ( ALPHA / "*" ) *( tchar / ":" / "/" ) </pre><a href="#section-3.3.4-3" class="pilcrow">¶</a> </div> <p id="section-3.3.4-4">For example:<a href="#section-3.3.4-4" class="pilcrow">¶</a></p> <div id="section-3.3.4-5"> <pre class="sourcecode lang-http-message"> Example-Token: foo123/456 </pre><a href="#section-3.3.4-5" class="pilcrow">¶</a> </div> <p id="section-3.3.4-6">Parsers <span class="bcp14">MUST</span> support Tokens with at least 512 characters.<a href="#section-3.3.4-6" class="pilcrow">¶</a></p> <p id="section-3.3.4-7">Note that Token allows the same characters as the "token" ABNF rule defined in <span>[<a href="#RFC7230" class="xref">RFC7230</a>]</span>, with the exceptions that the first character is required to be either ALPHA or "*", and ":" and "/" are also allowed in subsequent characters.<a href="#section-3.3.4-7" class="pilcrow">¶</a></p> </section> </div> <div id="binary"> <section id="section-3.3.5"> <h4 id="name-byte-sequences"> <a href="#section-3.3.5" class="section-number selfRef">3.3.5. </a><a href="#name-byte-sequences" class="section-name selfRef">Byte Sequences</a> </h4> <p id="section-3.3.5-1">Byte Sequences can be conveyed in Structured Fields.<a href="#section-3.3.5-1" class="pilcrow">¶</a></p> <p id="section-3.3.5-2">The ABNF for a Byte Sequence is:<a href="#section-3.3.5-2" class="pilcrow">¶</a></p> <div id="section-3.3.5-3"> <pre class="sourcecode lang-abnf"> sf-binary = ":" *(base64) ":" base64 = ALPHA / DIGIT / "+" / "/" / "=" </pre><a href="#section-3.3.5-3" class="pilcrow">¶</a> </div> <p id="section-3.3.5-4">A Byte Sequence is delimited with colons and encoded using base64 (<span>[<a href="#RFC4648" class="xref">RFC4648</a>], <a href="https://www.rfc-editor.org/rfc/rfc4648#section-4" class="relref">Section 4</a></span>). For example:<a href="#section-3.3.5-4" class="pilcrow">¶</a></p> <div id="section-3.3.5-5"> <pre class="sourcecode lang-http-message"> Example-ByteSequence: :cHJldGVuZCB0aGlzIGlzIGJpbmFyeSBjb250ZW50Lg==: </pre><a href="#section-3.3.5-5" class="pilcrow">¶</a> </div> <p id="section-3.3.5-6">Parsers <span class="bcp14">MUST</span> support Byte Sequences with at least 16384 octets after decoding.<a href="#section-3.3.5-6" class="pilcrow">¶</a></p> </section> </div> <div id="boolean"> <section id="section-3.3.6"> <h4 id="name-booleans"> <a href="#section-3.3.6" class="section-number selfRef">3.3.6. </a><a href="#name-booleans" class="section-name selfRef">Booleans</a> </h4> <p id="section-3.3.6-1">Boolean values can be conveyed in Structured Fields.<a href="#section-3.3.6-1" class="pilcrow">¶</a></p> <p id="section-3.3.6-2">The ABNF for a Boolean is:<a href="#section-3.3.6-2" class="pilcrow">¶</a></p> <div id="section-3.3.6-3"> <pre class="sourcecode lang-abnf"> sf-boolean = "?" boolean boolean = "0" / "1" </pre><a href="#section-3.3.6-3" class="pilcrow">¶</a> </div> <p id="section-3.3.6-4">A Boolean is indicated with a leading "?" character followed by a "1" for a true value or "0" for false. For example:<a href="#section-3.3.6-4" class="pilcrow">¶</a></p> <div id="section-3.3.6-5"> <pre class="sourcecode lang-http-message"> Example-Boolean: ?1 </pre><a href="#section-3.3.6-5" class="pilcrow">¶</a> </div> <p id="section-3.3.6-6">Note that in Dictionary (<a href="#dictionary" class="xref">Section 3.2</a>) and Parameter (<a href="#param" class="xref">Section 3.1.2</a>) values, Boolean true is indicated by omitting the value.<a href="#section-3.3.6-6" class="pilcrow">¶</a></p> </section> </div> </section> </div> </section> </div> <div id="text"> <section id="section-4"> <h2 id="name-working-with-structured-fie"> <a href="#section-4" class="section-number selfRef">4. </a><a href="#name-working-with-structured-fie" class="section-name selfRef">Working with Structured Fields in HTTP</a> </h2> <p id="section-4-1">This section defines how to serialize and parse Structured Fields in textual HTTP field values and other encodings compatible with them (e.g., in HTTP/2 <span>[<a href="#RFC7540" class="xref">RFC7540</a>]</span> before compression with HPACK <span>[<a href="#RFC7541" class="xref">RFC7541</a>]</span>).<a href="#section-4-1" class="pilcrow">¶</a></p> <div id="text-serialize"> <section id="section-4.1"> <h3 id="name-serializing-structured-fiel"> <a href="#section-4.1" class="section-number selfRef">4.1. </a><a href="#name-serializing-structured-fiel" class="section-name selfRef">Serializing Structured Fields</a> </h3> <p id="section-4.1-1">Given a structure defined in this specification, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1-2"> <li id="section-4.1-2.1">If the structure is a Dictionary or List and its value is empty (i.e., it has no members), do not serialize the field at all (i.e., omit both the field-name and field-value).<a href="#section-4.1-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1-2.2">If the structure is a List, let output_string be the result of running Serializing a List (<a href="#ser-list" class="xref">Section 4.1.1</a>) with the structure.<a href="#section-4.1-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1-2.3">Else, if the structure is a Dictionary, let output_string be the result of running Serializing a Dictionary (<a href="#ser-dictionary" class="xref">Section 4.1.2</a>) with the structure.<a href="#section-4.1-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1-2.4">Else, if the structure is an Item, let output_string be the result of running Serializing an Item (<a href="#ser-item" class="xref">Section 4.1.3</a>) with the structure.<a href="#section-4.1-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1-2.5">Else, fail serialization.<a href="#section-4.1-2.5" class="pilcrow">¶</a> </li> <li id="section-4.1-2.6">Return output_string converted into an array of bytes, using ASCII encoding <span>[<a href="#RFC0020" class="xref">RFC0020</a>]</span>.<a href="#section-4.1-2.6" class="pilcrow">¶</a> </li> </ol> <div id="ser-list"> <section id="section-4.1.1"> <h4 id="name-serializing-a-list"> <a href="#section-4.1.1" class="section-number selfRef">4.1.1. </a><a href="#name-serializing-a-list" class="section-name selfRef">Serializing a List</a> </h4> <p id="section-4.1.1-1">Given an array of (member_value, parameters) tuples as input_list, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.1-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1-2"> <li id="section-4.1.1-2.1">Let output be an empty string.<a href="#section-4.1.1-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1-2.2"> <p id="section-4.1.1-2.2.1">For each (member_value, parameters) of input_list:<a href="#section-4.1.1-2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1-2.2.2"> <li id="section-4.1.1-2.2.2.1">If member_value is an array, append the result of running Serializing an Inner List (<a href="#ser-innerlist" class="xref">Section 4.1.1.1</a>) with (member_value, parameters) to output.<a href="#section-4.1.1-2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1-2.2.2.2">Otherwise, append the result of running Serializing an Item (<a href="#ser-item" class="xref">Section 4.1.3</a>) with (member_value, parameters) to output.<a href="#section-4.1.1-2.2.2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.1-2.2.2.3"> <p id="section-4.1.1-2.2.2.3.1">If more member_values remain in input_list:<a href="#section-4.1.1-2.2.2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1-2.2.2.3.2"> <li id="section-4.1.1-2.2.2.3.2.1">Append "," to output.<a href="#section-4.1.1-2.2.2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1-2.2.2.3.2.2">Append a single SP to output.<a href="#section-4.1.1-2.2.2.3.2.2" class="pilcrow">¶</a> </li> </ol> </li> </ol> </li> <li id="section-4.1.1-2.3">Return output.<a href="#section-4.1.1-2.3" class="pilcrow">¶</a> </li> </ol> <div id="ser-innerlist"> <section id="section-4.1.1.1"> <h5 id="name-serializing-an-inner-list"> <a href="#section-4.1.1.1" class="section-number selfRef">4.1.1.1. </a><a href="#name-serializing-an-inner-list" class="section-name selfRef">Serializing an Inner List</a> </h5> <p id="section-4.1.1.1-1">Given an array of (member_value, parameters) tuples as inner_list, and parameters as list_parameters, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.1.1-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1.1-2"> <li id="section-4.1.1.1-2.1">Let output be the string "(".<a href="#section-4.1.1.1-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1.1-2.2"> <p id="section-4.1.1.1-2.2.1">For each (member_value, parameters) of inner_list:<a href="#section-4.1.1.1-2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1.1-2.2.2"> <li id="section-4.1.1.1-2.2.2.1">Append the result of running Serializing an Item (<a href="#ser-item" class="xref">Section 4.1.3</a>) with (member_value, parameters) to output.<a href="#section-4.1.1.1-2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1.1-2.2.2.2">If more values remain in inner_list, append a single SP to output.<a href="#section-4.1.1.1-2.2.2.2" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.1.1.1-2.3">Append ")" to output.<a href="#section-4.1.1.1-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.1.1-2.4">Append the result of running Serializing Parameters (<a href="#ser-params" class="xref">Section 4.1.1.2</a>) with list_parameters to output.<a href="#section-4.1.1.1-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.1.1-2.5">Return output.<a href="#section-4.1.1.1-2.5" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="ser-params"> <section id="section-4.1.1.2"> <h5 id="name-serializing-parameters"> <a href="#section-4.1.1.2" class="section-number selfRef">4.1.1.2. </a><a href="#name-serializing-parameters" class="section-name selfRef">Serializing Parameters</a> </h5> <p id="section-4.1.1.2-1">Given an ordered Dictionary as input_parameters (each member having a param_key and a param_value), return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.1.2-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1.2-2"> <li id="section-4.1.1.2-2.1">Let output be an empty string.<a href="#section-4.1.1.2-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1.2-2.2"> <p id="section-4.1.1.2-2.2.1">For each param_key with a value of param_value in input_parameters:<a href="#section-4.1.1.2-2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1.2-2.2.2"> <li id="section-4.1.1.2-2.2.2.1">Append ";" to output.<a href="#section-4.1.1.2-2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1.2-2.2.2.2">Append the result of running Serializing a Key (<a href="#ser-key" class="xref">Section 4.1.1.3</a>) with param_key to output.<a href="#section-4.1.1.2-2.2.2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.1.2-2.2.2.3"> <p id="section-4.1.1.2-2.2.2.3.1">If param_value is not Boolean true:<a href="#section-4.1.1.2-2.2.2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1.2-2.2.2.3.2"> <li id="section-4.1.1.2-2.2.2.3.2.1">Append "=" to output.<a href="#section-4.1.1.2-2.2.2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1.2-2.2.2.3.2.2">Append the result of running Serializing a bare Item (<a href="#ser-bare-item" class="xref">Section 4.1.3.1</a>) with param_value to output.<a href="#section-4.1.1.2-2.2.2.3.2.2" class="pilcrow">¶</a> </li> </ol> </li> </ol> </li> <li id="section-4.1.1.2-2.3">Return output.<a href="#section-4.1.1.2-2.3" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="ser-key"> <section id="section-4.1.1.3"> <h5 id="name-serializing-a-key"> <a href="#section-4.1.1.3" class="section-number selfRef">4.1.1.3. </a><a href="#name-serializing-a-key" class="section-name selfRef">Serializing a Key</a> </h5> <p id="section-4.1.1.3-1">Given a key as input_key, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.1.3-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.1.3-2"> <li id="section-4.1.1.3-2.1">Convert input_key into a sequence of ASCII characters; if conversion fails, fail serialization.<a href="#section-4.1.1.3-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.1.3-2.2">If input_key contains characters not in lcalpha, DIGIT, "_", "-", ".", or "*", fail serialization.<a href="#section-4.1.1.3-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.1.3-2.3">If the first character of input_key is not lcalpha or "*", fail serialization.<a href="#section-4.1.1.3-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.1.3-2.4">Let output be an empty string.<a href="#section-4.1.1.3-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.1.3-2.5">Append input_key to output.<a href="#section-4.1.1.3-2.5" class="pilcrow">¶</a> </li> <li id="section-4.1.1.3-2.6">Return output.<a href="#section-4.1.1.3-2.6" class="pilcrow">¶</a> </li> </ol> </section> </div> </section> </div> <div id="ser-dictionary"> <section id="section-4.1.2"> <h4 id="name-serializing-a-dictionary"> <a href="#section-4.1.2" class="section-number selfRef">4.1.2. </a><a href="#name-serializing-a-dictionary" class="section-name selfRef">Serializing a Dictionary</a> </h4> <p id="section-4.1.2-1">Given an ordered Dictionary as input_dictionary (each member having a member_key and a tuple value of (member_value, parameters)), return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.2-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.2-2"> <li id="section-4.1.2-2.1">Let output be an empty string.<a href="#section-4.1.2-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.2-2.2"> <p id="section-4.1.2-2.2.1">For each member_key with a value of (member_value, parameters) in input_dictionary:<a href="#section-4.1.2-2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.2-2.2.2"> <li id="section-4.1.2-2.2.2.1">Append the result of running Serializing a Key (<a href="#ser-key" class="xref">Section 4.1.1.3</a>) with member's member_key to output.<a href="#section-4.1.2-2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.2-2.2.2.2"> <p id="section-4.1.2-2.2.2.2.1">If member_value is Boolean true:<a href="#section-4.1.2-2.2.2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.2-2.2.2.2.2"> <li id="section-4.1.2-2.2.2.2.2.1">Append the result of running Serializing Parameters (<a href="#ser-params" class="xref">Section 4.1.1.2</a>) with parameters to output.<a href="#section-4.1.2-2.2.2.2.2.1" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.1.2-2.2.2.3"> <p id="section-4.1.2-2.2.2.3.1">Otherwise:<a href="#section-4.1.2-2.2.2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.2-2.2.2.3.2"> <li id="section-4.1.2-2.2.2.3.2.1">Append "=" to output.<a href="#section-4.1.2-2.2.2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.2-2.2.2.3.2.2">If member_value is an array, append the result of running Serializing an Inner List (<a href="#ser-innerlist" class="xref">Section 4.1.1.1</a>) with (member_value, parameters) to output.<a href="#section-4.1.2-2.2.2.3.2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.2-2.2.2.3.2.3">Otherwise, append the result of running Serializing an Item (<a href="#ser-item" class="xref">Section 4.1.3</a>) with (member_value, parameters) to output.<a href="#section-4.1.2-2.2.2.3.2.3" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.1.2-2.2.2.4"> <p id="section-4.1.2-2.2.2.4.1">If more members remain in input_dictionary:<a href="#section-4.1.2-2.2.2.4.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.2-2.2.2.4.2"> <li id="section-4.1.2-2.2.2.4.2.1">Append "," to output.<a href="#section-4.1.2-2.2.2.4.2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.2-2.2.2.4.2.2">Append a single SP to output.<a href="#section-4.1.2-2.2.2.4.2.2" class="pilcrow">¶</a> </li> </ol> </li> </ol> </li> <li id="section-4.1.2-2.3">Return output.<a href="#section-4.1.2-2.3" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="ser-item"> <section id="section-4.1.3"> <h4 id="name-serializing-an-item"> <a href="#section-4.1.3" class="section-number selfRef">4.1.3. </a><a href="#name-serializing-an-item" class="section-name selfRef">Serializing an Item</a> </h4> <p id="section-4.1.3-1">Given an Item as bare_item and Parameters as item_parameters, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.3-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.3-2"> <li id="section-4.1.3-2.1">Let output be an empty string.<a href="#section-4.1.3-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.3-2.2">Append the result of running Serializing a Bare Item (<a href="#ser-bare-item" class="xref">Section 4.1.3.1</a>) with bare_item to output.<a href="#section-4.1.3-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.3-2.3">Append the result of running Serializing Parameters (<a href="#ser-params" class="xref">Section 4.1.1.2</a>) with item_parameters to output.<a href="#section-4.1.3-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.3-2.4">Return output.<a href="#section-4.1.3-2.4" class="pilcrow">¶</a> </li> </ol> <div id="ser-bare-item"> <section id="section-4.1.3.1"> <h5 id="name-serializing-a-bare-item"> <a href="#section-4.1.3.1" class="section-number selfRef">4.1.3.1. </a><a href="#name-serializing-a-bare-item" class="section-name selfRef">Serializing a Bare Item</a> </h5> <p id="section-4.1.3.1-1">Given an Item as input_item, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.3.1-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.3.1-2"> <li id="section-4.1.3.1-2.1">If input_item is an Integer, return the result of running Serializing an Integer (<a href="#ser-integer" class="xref">Section 4.1.4</a>) with input_item.<a href="#section-4.1.3.1-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.3.1-2.2">If input_item is a Decimal, return the result of running Serializing a Decimal (<a href="#ser-decimal" class="xref">Section 4.1.5</a>) with input_item.<a href="#section-4.1.3.1-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.3.1-2.3">If input_item is a String, return the result of running Serializing a String (<a href="#ser-string" class="xref">Section 4.1.6</a>) with input_item.<a href="#section-4.1.3.1-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.3.1-2.4">If input_item is a Token, return the result of running Serializing a Token (<a href="#ser-token" class="xref">Section 4.1.7</a>) with input_item.<a href="#section-4.1.3.1-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.3.1-2.5">If input_item is a Byte Sequence, return the result of running Serializing a Byte Sequence (<a href="#ser-binary" class="xref">Section 4.1.8</a>) with input_item.<a href="#section-4.1.3.1-2.5" class="pilcrow">¶</a> </li> <li id="section-4.1.3.1-2.6">If input_item is a Boolean, return the result of running Serializing a Boolean (<a href="#ser-boolean" class="xref">Section 4.1.9</a>) with input_item.<a href="#section-4.1.3.1-2.6" class="pilcrow">¶</a> </li> <li id="section-4.1.3.1-2.7">Otherwise, fail serialization.<a href="#section-4.1.3.1-2.7" class="pilcrow">¶</a> </li> </ol> </section> </div> </section> </div> <div id="ser-integer"> <section id="section-4.1.4"> <h4 id="name-serializing-an-integer"> <a href="#section-4.1.4" class="section-number selfRef">4.1.4. </a><a href="#name-serializing-an-integer" class="section-name selfRef">Serializing an Integer</a> </h4> <p id="section-4.1.4-1">Given an Integer as input_integer, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.4-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.4-2"> <li id="section-4.1.4-2.1">If input_integer is not an integer in the range of -999,999,999,999,999 to 999,999,999,999,999 inclusive, fail serialization.<a href="#section-4.1.4-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.4-2.2">Let output be an empty string.<a href="#section-4.1.4-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.4-2.3">If input_integer is less than (but not equal to) 0, append "-" to output.<a href="#section-4.1.4-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.4-2.4">Append input_integer's numeric value represented in base 10 using only decimal digits to output.<a href="#section-4.1.4-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.4-2.5">Return output.<a href="#section-4.1.4-2.5" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="ser-decimal"> <section id="section-4.1.5"> <h4 id="name-serializing-a-decimal"> <a href="#section-4.1.5" class="section-number selfRef">4.1.5. </a><a href="#name-serializing-a-decimal" class="section-name selfRef">Serializing a Decimal</a> </h4> <p id="section-4.1.5-1">Given a decimal number as input_decimal, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.5-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.5-2"> <li id="section-4.1.5-2.1">If input_decimal is not a decimal number, fail serialization.<a href="#section-4.1.5-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.2">If input_decimal has more than three significant digits to the right of the decimal point, round it to three decimal places, rounding the final digit to the nearest value, or to the even value if it is equidistant.<a href="#section-4.1.5-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.3">If input_decimal has more than 12 significant digits to the left of the decimal point after rounding, fail serialization.<a href="#section-4.1.5-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.4">Let output be an empty string.<a href="#section-4.1.5-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.5">If input_decimal is less than (but not equal to) 0, append "-" to output.<a href="#section-4.1.5-2.5" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.6">Append input_decimal's integer component represented in base 10 (using only decimal digits) to output; if it is zero, append "0".<a href="#section-4.1.5-2.6" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.7">Append "." to output.<a href="#section-4.1.5-2.7" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.8">If input_decimal's fractional component is zero, append "0" to output.<a href="#section-4.1.5-2.8" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.9">Otherwise, append the significant digits of input_decimal's fractional component represented in base 10 (using only decimal digits) to output.<a href="#section-4.1.5-2.9" class="pilcrow">¶</a> </li> <li id="section-4.1.5-2.10">Return output.<a href="#section-4.1.5-2.10" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="ser-string"> <section id="section-4.1.6"> <h4 id="name-serializing-a-string"> <a href="#section-4.1.6" class="section-number selfRef">4.1.6. </a><a href="#name-serializing-a-string" class="section-name selfRef">Serializing a String</a> </h4> <p id="section-4.1.6-1">Given a String as input_string, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.6-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.6-2"> <li id="section-4.1.6-2.1">Convert input_string into a sequence of ASCII characters; if conversion fails, fail serialization.<a href="#section-4.1.6-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.6-2.2">If input_string contains characters in the range %x00-1f or %x7f-ff (i.e., not in VCHAR or SP), fail serialization.<a href="#section-4.1.6-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.6-2.3">Let output be the string DQUOTE.<a href="#section-4.1.6-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.6-2.4"> <p id="section-4.1.6-2.4.1">For each character char in input_string:<a href="#section-4.1.6-2.4.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.6-2.4.2"> <li id="section-4.1.6-2.4.2.1"> <p id="section-4.1.6-2.4.2.1.1">If char is "\" or DQUOTE:<a href="#section-4.1.6-2.4.2.1.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.6-2.4.2.1.2"> <li id="section-4.1.6-2.4.2.1.2.1">Append "\" to output.<a href="#section-4.1.6-2.4.2.1.2.1" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.1.6-2.4.2.2">Append char to output.<a href="#section-4.1.6-2.4.2.2" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.1.6-2.5">Append DQUOTE to output.<a href="#section-4.1.6-2.5" class="pilcrow">¶</a> </li> <li id="section-4.1.6-2.6">Return output.<a href="#section-4.1.6-2.6" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="ser-token"> <section id="section-4.1.7"> <h4 id="name-serializing-a-token"> <a href="#section-4.1.7" class="section-number selfRef">4.1.7. </a><a href="#name-serializing-a-token" class="section-name selfRef">Serializing a Token</a> </h4> <p id="section-4.1.7-1">Given a Token as input_token, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.7-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.7-2"> <li id="section-4.1.7-2.1">Convert input_token into a sequence of ASCII characters; if conversion fails, fail serialization.<a href="#section-4.1.7-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.7-2.2">If the first character of input_token is not ALPHA or "*", or the remaining portion contains a character not in tchar, ":", or "/", fail serialization.<a href="#section-4.1.7-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.7-2.3">Let output be an empty string.<a href="#section-4.1.7-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.7-2.4">Append input_token to output.<a href="#section-4.1.7-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.7-2.5">Return output.<a href="#section-4.1.7-2.5" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="ser-binary"> <section id="section-4.1.8"> <h4 id="name-serializing-a-byte-sequence"> <a href="#section-4.1.8" class="section-number selfRef">4.1.8. </a><a href="#name-serializing-a-byte-sequence" class="section-name selfRef">Serializing a Byte Sequence</a> </h4> <p id="section-4.1.8-1">Given a Byte Sequence as input_bytes, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.8-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.8-2"> <li id="section-4.1.8-2.1">If input_bytes is not a sequence of bytes, fail serialization.<a href="#section-4.1.8-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.8-2.2">Let output be an empty string.<a href="#section-4.1.8-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.8-2.3">Append ":" to output.<a href="#section-4.1.8-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.8-2.4">Append the result of base64-encoding input_bytes as per <span>[<a href="#RFC4648" class="xref">RFC4648</a>], <a href="https://www.rfc-editor.org/rfc/rfc4648#section-4" class="relref">Section 4</a></span>, taking account of the requirements below.<a href="#section-4.1.8-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.8-2.5">Append ":" to output.<a href="#section-4.1.8-2.5" class="pilcrow">¶</a> </li> <li id="section-4.1.8-2.6">Return output.<a href="#section-4.1.8-2.6" class="pilcrow">¶</a> </li> </ol> <p id="section-4.1.8-3">The encoded data is required to be padded with "=", as per <span>[<a href="#RFC4648" class="xref">RFC4648</a>], <a href="https://www.rfc-editor.org/rfc/rfc4648#section-3.2" class="relref">Section 3.2</a></span>.<a href="#section-4.1.8-3" class="pilcrow">¶</a></p> <p id="section-4.1.8-4">Likewise, encoded data <span class="bcp14">SHOULD</span> have pad bits set to zero, as per <span>[<a href="#RFC4648" class="xref">RFC4648</a>], <a href="https://www.rfc-editor.org/rfc/rfc4648#section-3.5" class="relref">Section 3.5</a></span>, unless it is not possible to do so due to implementation constraints.<a href="#section-4.1.8-4" class="pilcrow">¶</a></p> </section> </div> <div id="ser-boolean"> <section id="section-4.1.9"> <h4 id="name-serializing-a-boolean"> <a href="#section-4.1.9" class="section-number selfRef">4.1.9. </a><a href="#name-serializing-a-boolean" class="section-name selfRef">Serializing a Boolean</a> </h4> <p id="section-4.1.9-1">Given a Boolean as input_boolean, return an ASCII string suitable for use in an HTTP field value.<a href="#section-4.1.9-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.1.9-2"> <li id="section-4.1.9-2.1">If input_boolean is not a boolean, fail serialization.<a href="#section-4.1.9-2.1" class="pilcrow">¶</a> </li> <li id="section-4.1.9-2.2">Let output be an empty string.<a href="#section-4.1.9-2.2" class="pilcrow">¶</a> </li> <li id="section-4.1.9-2.3">Append "?" to output.<a href="#section-4.1.9-2.3" class="pilcrow">¶</a> </li> <li id="section-4.1.9-2.4">If input_boolean is true, append "1" to output.<a href="#section-4.1.9-2.4" class="pilcrow">¶</a> </li> <li id="section-4.1.9-2.5">If input_boolean is false, append "0" to output.<a href="#section-4.1.9-2.5" class="pilcrow">¶</a> </li> <li id="section-4.1.9-2.6">Return output.<a href="#section-4.1.9-2.6" class="pilcrow">¶</a> </li> </ol> </section> </div> </section> </div> <div id="text-parse"> <section id="section-4.2"> <h3 id="name-parsing-structured-fields"> <a href="#section-4.2" class="section-number selfRef">4.2. </a><a href="#name-parsing-structured-fields" class="section-name selfRef">Parsing Structured Fields</a> </h3> <p id="section-4.2-1">When a receiving implementation parses HTTP fields that are known to be Structured Fields, it is important that care be taken, as there are a number of edge cases that can cause interoperability or even security problems. This section specifies the algorithm for doing so.<a href="#section-4.2-1" class="pilcrow">¶</a></p> <p id="section-4.2-2">Given an array of bytes as input_bytes that represent the chosen field's field-value (which is empty if that field is not present) and field_type (one of "dictionary", "list", or "item"), return the parsed header value.<a href="#section-4.2-2" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2-3"> <li id="section-4.2-3.1">Convert input_bytes into an ASCII string input_string; if conversion fails, fail parsing.<a href="#section-4.2-3.1" class="pilcrow">¶</a> </li> <li id="section-4.2-3.2">Discard any leading SP characters from input_string.<a href="#section-4.2-3.2" class="pilcrow">¶</a> </li> <li id="section-4.2-3.3">If field_type is "list", let output be the result of running Parsing a List (<a href="#parse-list" class="xref">Section 4.2.1</a>) with input_string.<a href="#section-4.2-3.3" class="pilcrow">¶</a> </li> <li id="section-4.2-3.4">If field_type is "dictionary", let output be the result of running Parsing a Dictionary (<a href="#parse-dictionary" class="xref">Section 4.2.2</a>) with input_string.<a href="#section-4.2-3.4" class="pilcrow">¶</a> </li> <li id="section-4.2-3.5">If field_type is "item", let output be the result of running Parsing an Item (<a href="#parse-item" class="xref">Section 4.2.3</a>) with input_string.<a href="#section-4.2-3.5" class="pilcrow">¶</a> </li> <li id="section-4.2-3.6">Discard any leading SP characters from input_string.<a href="#section-4.2-3.6" class="pilcrow">¶</a> </li> <li id="section-4.2-3.7">If input_string is not empty, fail parsing.<a href="#section-4.2-3.7" class="pilcrow">¶</a> </li> <li id="section-4.2-3.8">Otherwise, return output.<a href="#section-4.2-3.8" class="pilcrow">¶</a> </li> </ol> <p id="section-4.2-4">When generating input_bytes, parsers <span class="bcp14">MUST</span> combine all field lines in the same section (header or trailer) that case-insensitively match the field name into one comma-separated field-value, as per <span>[<a href="#RFC7230" class="xref">RFC7230</a>], <a href="https://www.rfc-editor.org/rfc/rfc7230#section-3.2.2" class="relref">Section 3.2.2</a></span>; this assures that the entire field value is processed correctly.<a href="#section-4.2-4" class="pilcrow">¶</a></p> <p id="section-4.2-5">For Lists and Dictionaries, this has the effect of correctly concatenating all of the field's lines, as long as individual members of the top-level data structure are not split across multiple header instances. The parsing algorithms for both types allow tab characters, since these might be used to combine field lines by some implementations.<a href="#section-4.2-5" class="pilcrow">¶</a></p> <p id="section-4.2-6">Strings split across multiple field lines will have unpredictable results, because one or more commas (with optional whitespace) will become part of the string output by the parser. Since concatenation might be done by an upstream intermediary, the results are not under the control of the serializer or the parser, even when they are both under the control of the same party.<a href="#section-4.2-6" class="pilcrow">¶</a></p> <p id="section-4.2-7">Tokens, Integers, Decimals, and Byte Sequences cannot be split across multiple field lines because the inserted commas will cause parsing to fail.<a href="#section-4.2-7" class="pilcrow">¶</a></p> <p id="section-4.2-8">Parsers <span class="bcp14">MAY</span> fail when processing a field value spread across multiple field lines, when one of those lines does not parse as that field. For example, a parsing handling an Example-String field that's defined as an sf-string is allowed to fail when processing this field section:<a href="#section-4.2-8" class="pilcrow">¶</a></p> <div id="section-4.2-9"> <pre class="sourcecode lang-http-message"> Example-String: "foo Example-String: bar" </pre><a href="#section-4.2-9" class="pilcrow">¶</a> </div> <p id="section-4.2-10">If parsing fails -- including when calling another algorithm -- the entire field value <span class="bcp14">MUST</span> be ignored (i.e., treated as if the field were not present in the section). This is intentionally strict, to improve interoperability and safety, and specifications referencing this document are not allowed to loosen this requirement.<a href="#section-4.2-10" class="pilcrow">¶</a></p> <p id="section-4.2-11">Note that this requirement does not apply to an implementation that is not parsing the field; for example, an intermediary is not required to strip a failing field from a message before forwarding it.<a href="#section-4.2-11" class="pilcrow">¶</a></p> <div id="parse-list"> <section id="section-4.2.1"> <h4 id="name-parsing-a-list"> <a href="#section-4.2.1" class="section-number selfRef">4.2.1. </a><a href="#name-parsing-a-list" class="section-name selfRef">Parsing a List</a> </h4> <p id="section-4.2.1-1">Given an ASCII string as input_string, return an array of (item_or_inner_list, parameters) tuples. input_string is modified to remove the parsed value.<a href="#section-4.2.1-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.1-2"> <li id="section-4.2.1-2.1">Let members be an empty array.<a href="#section-4.2.1-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.1-2.2"> <p id="section-4.2.1-2.2.1">While input_string is not empty:<a href="#section-4.2.1-2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.1-2.2.2"> <li id="section-4.2.1-2.2.2.1">Append the result of running Parsing an Item or Inner List (<a href="#parse-item-or-list" class="xref">Section 4.2.1.1</a>) with input_string to members.<a href="#section-4.2.1-2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.1-2.2.2.2">Discard any leading OWS characters from input_string.<a href="#section-4.2.1-2.2.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.1-2.2.2.3">If input_string is empty, return members.<a href="#section-4.2.1-2.2.2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.1-2.2.2.4">Consume the first character of input_string; if it is not ",", fail parsing.<a href="#section-4.2.1-2.2.2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.1-2.2.2.5">Discard any leading OWS characters from input_string.<a href="#section-4.2.1-2.2.2.5" class="pilcrow">¶</a> </li> <li id="section-4.2.1-2.2.2.6">If input_string is empty, there is a trailing comma; fail parsing.<a href="#section-4.2.1-2.2.2.6" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.1-2.3">No structured data has been found; return members (which is empty).<a href="#section-4.2.1-2.3" class="pilcrow">¶</a> </li> </ol> <div id="parse-item-or-list"> <section id="section-4.2.1.1"> <h5 id="name-parsing-an-item-or-inner-li"> <a href="#section-4.2.1.1" class="section-number selfRef">4.2.1.1. </a><a href="#name-parsing-an-item-or-inner-li" class="section-name selfRef">Parsing an Item or Inner List</a> </h5> <p id="section-4.2.1.1-1">Given an ASCII string as input_string, return the tuple (item_or_inner_list, parameters), where item_or_inner_list can be either a single bare item or an array of (bare_item, parameters) tuples. input_string is modified to remove the parsed value.<a href="#section-4.2.1.1-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.1.1-2"> <li id="section-4.2.1.1-2.1">If the first character of input_string is "(", return the result of running Parsing an Inner List (<a href="#parse-innerlist" class="xref">Section 4.2.1.2</a>) with input_string.<a href="#section-4.2.1.1-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.1.1-2.2">Return the result of running Parsing an Item (<a href="#parse-item" class="xref">Section 4.2.3</a>) with input_string.<a href="#section-4.2.1.1-2.2" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="parse-innerlist"> <section id="section-4.2.1.2"> <h5 id="name-parsing-an-inner-list"> <a href="#section-4.2.1.2" class="section-number selfRef">4.2.1.2. </a><a href="#name-parsing-an-inner-list" class="section-name selfRef">Parsing an Inner List</a> </h5> <p id="section-4.2.1.2-1">Given an ASCII string as input_string, return the tuple (inner_list, parameters), where inner_list is an array of (bare_item, parameters) tuples. input_string is modified to remove the parsed value.<a href="#section-4.2.1.2-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.1.2-2"> <li id="section-4.2.1.2-2.1">Consume the first character of input_string; if it is not "(", fail parsing.<a href="#section-4.2.1.2-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.1.2-2.2">Let inner_list be an empty array.<a href="#section-4.2.1.2-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.1.2-2.3"> <p id="section-4.2.1.2-2.3.1">While input_string is not empty:<a href="#section-4.2.1.2-2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.1.2-2.3.2"> <li id="section-4.2.1.2-2.3.2.1">Discard any leading SP characters from input_string.<a href="#section-4.2.1.2-2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.1.2-2.3.2.2"> <p id="section-4.2.1.2-2.3.2.2.1">If the first character of input_string is ")":<a href="#section-4.2.1.2-2.3.2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.1.2-2.3.2.2.2"> <li id="section-4.2.1.2-2.3.2.2.2.1">Consume the first character of input_string.<a href="#section-4.2.1.2-2.3.2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.1.2-2.3.2.2.2.2">Let parameters be the result of running Parsing Parameters (<a href="#parse-param" class="xref">Section 4.2.3.2</a>) with input_string.<a href="#section-4.2.1.2-2.3.2.2.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.1.2-2.3.2.2.2.3">Return the tuple (inner_list, parameters).<a href="#section-4.2.1.2-2.3.2.2.2.3" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.1.2-2.3.2.3">Let item be the result of running Parsing an Item (<a href="#parse-item" class="xref">Section 4.2.3</a>) with input_string.<a href="#section-4.2.1.2-2.3.2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.1.2-2.3.2.4">Append item to inner_list.<a href="#section-4.2.1.2-2.3.2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.1.2-2.3.2.5">If the first character of input_string is not SP or ")", fail parsing.<a href="#section-4.2.1.2-2.3.2.5" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.1.2-2.4">The end of the Inner List was not found; fail parsing.<a href="#section-4.2.1.2-2.4" class="pilcrow">¶</a> </li> </ol> </section> </div> </section> </div> <div id="parse-dictionary"> <section id="section-4.2.2"> <h4 id="name-parsing-a-dictionary"> <a href="#section-4.2.2" class="section-number selfRef">4.2.2. </a><a href="#name-parsing-a-dictionary" class="section-name selfRef">Parsing a Dictionary</a> </h4> <p id="section-4.2.2-1">Given an ASCII string as input_string, return an ordered map whose values are (item_or_inner_list, parameters) tuples. input_string is modified to remove the parsed value.<a href="#section-4.2.2-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.2-2"> <li id="section-4.2.2-2.1">Let dictionary be an empty, ordered map.<a href="#section-4.2.2-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2"> <p id="section-4.2.2-2.2.1">While input_string is not empty:<a href="#section-4.2.2-2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.2-2.2.2"> <li id="section-4.2.2-2.2.2.1">Let this_key be the result of running Parsing a Key (<a href="#parse-key" class="xref">Section 4.2.3.3</a>) with input_string.<a href="#section-4.2.2-2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.2"> <p id="section-4.2.2-2.2.2.2.1">If the first character of input_string is "=":<a href="#section-4.2.2-2.2.2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.2-2.2.2.2.2"> <li id="section-4.2.2-2.2.2.2.2.1">Consume the first character of input_string.<a href="#section-4.2.2-2.2.2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.2.2.2">Let member be the result of running Parsing an Item or Inner List (<a href="#parse-item-or-list" class="xref">Section 4.2.1.1</a>) with input_string.<a href="#section-4.2.2-2.2.2.2.2.2" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.2-2.2.2.3"> <p id="section-4.2.2-2.2.2.3.1">Otherwise:<a href="#section-4.2.2-2.2.2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.2-2.2.2.3.2"> <li id="section-4.2.2-2.2.2.3.2.1">Let value be Boolean true.<a href="#section-4.2.2-2.2.2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.3.2.2">Let parameters be the result of running Parsing Parameters (<a href="#parse-param" class="xref">Section 4.2.3.2</a>) with input_string.<a href="#section-4.2.2-2.2.2.3.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.3.2.3">Let member be the tuple (value, parameters).<a href="#section-4.2.2-2.2.2.3.2.3" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.2-2.2.2.4">If dictionary already contains a key this_key (comparing character for character), overwrite its value with member.<a href="#section-4.2.2-2.2.2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.5">Otherwise, append key this_key with value member to dictionary.<a href="#section-4.2.2-2.2.2.5" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.6">Discard any leading OWS characters from input_string.<a href="#section-4.2.2-2.2.2.6" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.7">If input_string is empty, return dictionary.<a href="#section-4.2.2-2.2.2.7" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.8">Consume the first character of input_string; if it is not ",", fail parsing.<a href="#section-4.2.2-2.2.2.8" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.9">Discard any leading OWS characters from input_string.<a href="#section-4.2.2-2.2.2.9" class="pilcrow">¶</a> </li> <li id="section-4.2.2-2.2.2.10">If input_string is empty, there is a trailing comma; fail parsing.<a href="#section-4.2.2-2.2.2.10" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.2-2.3">No structured data has been found; return dictionary (which is empty).<a href="#section-4.2.2-2.3" class="pilcrow">¶</a> </li> </ol> <p id="section-4.2.2-3">Note that when duplicate Dictionary keys are encountered, all but the last instance are ignored.<a href="#section-4.2.2-3" class="pilcrow">¶</a></p> </section> </div> <div id="parse-item"> <section id="section-4.2.3"> <h4 id="name-parsing-an-item"> <a href="#section-4.2.3" class="section-number selfRef">4.2.3. </a><a href="#name-parsing-an-item" class="section-name selfRef">Parsing an Item</a> </h4> <p id="section-4.2.3-1">Given an ASCII string as input_string, return a (bare_item, parameters) tuple. input_string is modified to remove the parsed value.<a href="#section-4.2.3-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.3-2"> <li id="section-4.2.3-2.1">Let bare_item be the result of running Parsing a Bare Item (<a href="#parse-bare-item" class="xref">Section 4.2.3.1</a>) with input_string.<a href="#section-4.2.3-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.3-2.2">Let parameters be the result of running Parsing Parameters (<a href="#parse-param" class="xref">Section 4.2.3.2</a>) with input_string.<a href="#section-4.2.3-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.3-2.3">Return the tuple (bare_item, parameters).<a href="#section-4.2.3-2.3" class="pilcrow">¶</a> </li> </ol> <div id="parse-bare-item"> <section id="section-4.2.3.1"> <h5 id="name-parsing-a-bare-item"> <a href="#section-4.2.3.1" class="section-number selfRef">4.2.3.1. </a><a href="#name-parsing-a-bare-item" class="section-name selfRef">Parsing a Bare Item</a> </h5> <p id="section-4.2.3.1-1">Given an ASCII string as input_string, return a bare Item. input_string is modified to remove the parsed value.<a href="#section-4.2.3.1-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.3.1-2"> <li id="section-4.2.3.1-2.1">If the first character of input_string is a "-" or a DIGIT, return the result of running Parsing an Integer or Decimal (<a href="#parse-number" class="xref">Section 4.2.4</a>) with input_string.<a href="#section-4.2.3.1-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.3.1-2.2">If the first character of input_string is a DQUOTE, return the result of running Parsing a String (<a href="#parse-string" class="xref">Section 4.2.5</a>) with input_string.<a href="#section-4.2.3.1-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.3.1-2.3">If the first character of input_string is an ALPHA or "*", return the result of running Parsing a Token (<a href="#parse-token" class="xref">Section 4.2.6</a>) with input_string.<a href="#section-4.2.3.1-2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.3.1-2.4">If the first character of input_string is ":", return the result of running Parsing a Byte Sequence (<a href="#parse-binary" class="xref">Section 4.2.7</a>) with input_string.<a href="#section-4.2.3.1-2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.3.1-2.5">If the first character of input_string is "?", return the result of running Parsing a Boolean (<a href="#parse-boolean" class="xref">Section 4.2.8</a>) with input_string.<a href="#section-4.2.3.1-2.5" class="pilcrow">¶</a> </li> <li id="section-4.2.3.1-2.6">Otherwise, the item type is unrecognized; fail parsing.<a href="#section-4.2.3.1-2.6" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="parse-param"> <section id="section-4.2.3.2"> <h5 id="name-parsing-parameters"> <a href="#section-4.2.3.2" class="section-number selfRef">4.2.3.2. </a><a href="#name-parsing-parameters" class="section-name selfRef">Parsing Parameters</a> </h5> <p id="section-4.2.3.2-1">Given an ASCII string as input_string, return an ordered map whose values are bare Items. input_string is modified to remove the parsed value.<a href="#section-4.2.3.2-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.3.2-2"> <li id="section-4.2.3.2-2.1">Let parameters be an empty, ordered map.<a href="#section-4.2.3.2-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2"> <p id="section-4.2.3.2-2.2.1">While input_string is not empty:<a href="#section-4.2.3.2-2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.3.2-2.2.2"> <li id="section-4.2.3.2-2.2.2.1">If the first character of input_string is not ";", exit the loop.<a href="#section-4.2.3.2-2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2.2.2">Consume the ";" character from the beginning of input_string.<a href="#section-4.2.3.2-2.2.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2.2.3">Discard any leading SP characters from input_string.<a href="#section-4.2.3.2-2.2.2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2.2.4">Let param_key be the result of running Parsing a Key (<a href="#parse-key" class="xref">Section 4.2.3.3</a>) with input_string.<a href="#section-4.2.3.2-2.2.2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2.2.5">Let param_value be Boolean true.<a href="#section-4.2.3.2-2.2.2.5" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2.2.6"> <p id="section-4.2.3.2-2.2.2.6.1">If the first character of input_string is "=":<a href="#section-4.2.3.2-2.2.2.6.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.3.2-2.2.2.6.2"> <li id="section-4.2.3.2-2.2.2.6.2.1">Consume the "=" character at the beginning of input_string.<a href="#section-4.2.3.2-2.2.2.6.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2.2.6.2.2">Let param_value be the result of running Parsing a Bare Item (<a href="#parse-bare-item" class="xref">Section 4.2.3.1</a>) with input_string.<a href="#section-4.2.3.2-2.2.2.6.2.2" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.3.2-2.2.2.7">If parameters already contains a key param_key (comparing character for character), overwrite its value with param_value.<a href="#section-4.2.3.2-2.2.2.7" class="pilcrow">¶</a> </li> <li id="section-4.2.3.2-2.2.2.8">Otherwise, append key param_key with value param_value to parameters.<a href="#section-4.2.3.2-2.2.2.8" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.3.2-2.3">Return parameters.<a href="#section-4.2.3.2-2.3" class="pilcrow">¶</a> </li> </ol> <p id="section-4.2.3.2-3">Note that when duplicate parameter keys are encountered, all but the last instance are ignored.<a href="#section-4.2.3.2-3" class="pilcrow">¶</a></p> </section> </div> <div id="parse-key"> <section id="section-4.2.3.3"> <h5 id="name-parsing-a-key"> <a href="#section-4.2.3.3" class="section-number selfRef">4.2.3.3. </a><a href="#name-parsing-a-key" class="section-name selfRef">Parsing a Key</a> </h5> <p id="section-4.2.3.3-1">Given an ASCII string as input_string, return a key. input_string is modified to remove the parsed value.<a href="#section-4.2.3.3-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.3.3-2"> <li id="section-4.2.3.3-2.1">If the first character of input_string is not lcalpha or "*", fail parsing.<a href="#section-4.2.3.3-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.3.3-2.2">Let output_string be an empty string.<a href="#section-4.2.3.3-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.3.3-2.3"> <p id="section-4.2.3.3-2.3.1">While input_string is not empty:<a href="#section-4.2.3.3-2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.3.3-2.3.2"> <li id="section-4.2.3.3-2.3.2.1">If the first character of input_string is not one of lcalpha, DIGIT, "_", "-", ".", or "*", return output_string.<a href="#section-4.2.3.3-2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.3.3-2.3.2.2">Let char be the result of consuming the first character of input_string.<a href="#section-4.2.3.3-2.3.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.3.3-2.3.2.3">Append char to output_string.<a href="#section-4.2.3.3-2.3.2.3" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.3.3-2.4">Return output_string.<a href="#section-4.2.3.3-2.4" class="pilcrow">¶</a> </li> </ol> </section> </div> </section> </div> <div id="parse-number"> <section id="section-4.2.4"> <h4 id="name-parsing-an-integer-or-decim"> <a href="#section-4.2.4" class="section-number selfRef">4.2.4. </a><a href="#name-parsing-an-integer-or-decim" class="section-name selfRef">Parsing an Integer or Decimal</a> </h4> <p id="section-4.2.4-1">Given an ASCII string as input_string, return an Integer or Decimal. input_string is modified to remove the parsed value.<a href="#section-4.2.4-1" class="pilcrow">¶</a></p> <p id="section-4.2.4-2">NOTE: This algorithm parses both Integers (<a href="#integer" class="xref">Section 3.3.1</a>) and Decimals (<a href="#decimal" class="xref">Section 3.3.2</a>), and returns the corresponding structure.<a href="#section-4.2.4-2" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.4-3"> <li id="section-4.2.4-3.1">Let type be "integer".<a href="#section-4.2.4-3.1" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.2">Let sign be 1.<a href="#section-4.2.4-3.2" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.3">Let input_number be an empty string.<a href="#section-4.2.4-3.3" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.4">If the first character of input_string is "-", consume it and set sign to -1.<a href="#section-4.2.4-3.4" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.5">If input_string is empty, there is an empty integer; fail parsing.<a href="#section-4.2.4-3.5" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.6">If the first character of input_string is not a DIGIT, fail parsing.<a href="#section-4.2.4-3.6" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.7"> <p id="section-4.2.4-3.7.1">While input_string is not empty:<a href="#section-4.2.4-3.7.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.4-3.7.2"> <li id="section-4.2.4-3.7.2.1">Let char be the result of consuming the first character of input_string.<a href="#section-4.2.4-3.7.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.7.2.2">If char is a DIGIT, append it to input_number.<a href="#section-4.2.4-3.7.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.7.2.3"> <p id="section-4.2.4-3.7.2.3.1">Else, if type is "integer" and char is ".":<a href="#section-4.2.4-3.7.2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.4-3.7.2.3.2"> <li id="section-4.2.4-3.7.2.3.2.1">If input_number contains more than 12 characters, fail parsing.<a href="#section-4.2.4-3.7.2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.7.2.3.2.2">Otherwise, append char to input_number and set type to "decimal".<a href="#section-4.2.4-3.7.2.3.2.2" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.4-3.7.2.4">Otherwise, prepend char to input_string, and exit the loop.<a href="#section-4.2.4-3.7.2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.7.2.5">If type is "integer" and input_number contains more than 15 characters, fail parsing.<a href="#section-4.2.4-3.7.2.5" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.7.2.6">If type is "decimal" and input_number contains more than 16 characters, fail parsing.<a href="#section-4.2.4-3.7.2.6" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.4-3.8"> <p id="section-4.2.4-3.8.1">If type is "integer":<a href="#section-4.2.4-3.8.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.4-3.8.2"> <li id="section-4.2.4-3.8.2.1">Parse input_number as an integer and let output_number be the product of the result and sign.<a href="#section-4.2.4-3.8.2.1" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.4-3.9"> <p id="section-4.2.4-3.9.1">Otherwise:<a href="#section-4.2.4-3.9.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.4-3.9.2"> <li id="section-4.2.4-3.9.2.1">If the final character of input_number is ".", fail parsing.<a href="#section-4.2.4-3.9.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.9.2.2">If the number of characters after "." in input_number is greater than three, fail parsing.<a href="#section-4.2.4-3.9.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.4-3.9.2.3">Parse input_number as a decimal number and let output_number be the product of the result and sign.<a href="#section-4.2.4-3.9.2.3" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.4-3.10">Return output_number.<a href="#section-4.2.4-3.10" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="parse-string"> <section id="section-4.2.5"> <h4 id="name-parsing-a-string"> <a href="#section-4.2.5" class="section-number selfRef">4.2.5. </a><a href="#name-parsing-a-string" class="section-name selfRef">Parsing a String</a> </h4> <p id="section-4.2.5-1">Given an ASCII string as input_string, return an unquoted String. input_string is modified to remove the parsed value.<a href="#section-4.2.5-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.5-2"> <li id="section-4.2.5-2.1">Let output_string be an empty string.<a href="#section-4.2.5-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.2">If the first character of input_string is not DQUOTE, fail parsing.<a href="#section-4.2.5-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.3">Discard the first character of input_string.<a href="#section-4.2.5-2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.4"> <p id="section-4.2.5-2.4.1">While input_string is not empty:<a href="#section-4.2.5-2.4.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.5-2.4.2"> <li id="section-4.2.5-2.4.2.1">Let char be the result of consuming the first character of input_string.<a href="#section-4.2.5-2.4.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.4.2.2"> <p id="section-4.2.5-2.4.2.2.1">If char is a backslash ("\"):<a href="#section-4.2.5-2.4.2.2.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.5-2.4.2.2.2"> <li id="section-4.2.5-2.4.2.2.2.1">If input_string is now empty, fail parsing.<a href="#section-4.2.5-2.4.2.2.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.4.2.2.2.2">Let next_char be the result of consuming the first character of input_string.<a href="#section-4.2.5-2.4.2.2.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.4.2.2.2.3">If next_char is not DQUOTE or "\", fail parsing.<a href="#section-4.2.5-2.4.2.2.2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.4.2.2.2.4">Append next_char to output_string.<a href="#section-4.2.5-2.4.2.2.2.4" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.5-2.4.2.3">Else, if char is DQUOTE, return output_string.<a href="#section-4.2.5-2.4.2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.4.2.4">Else, if char is in the range %x00-1f or %x7f-ff (i.e., it is not in VCHAR or SP), fail parsing.<a href="#section-4.2.5-2.4.2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.5-2.4.2.5">Else, append char to output_string.<a href="#section-4.2.5-2.4.2.5" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.5-2.5">Reached the end of input_string without finding a closing DQUOTE; fail parsing.<a href="#section-4.2.5-2.5" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="parse-token"> <section id="section-4.2.6"> <h4 id="name-parsing-a-token"> <a href="#section-4.2.6" class="section-number selfRef">4.2.6. </a><a href="#name-parsing-a-token" class="section-name selfRef">Parsing a Token</a> </h4> <p id="section-4.2.6-1">Given an ASCII string as input_string, return a Token. input_string is modified to remove the parsed value.<a href="#section-4.2.6-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.6-2"> <li id="section-4.2.6-2.1">If the first character of input_string is not ALPHA or "*", fail parsing.<a href="#section-4.2.6-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.6-2.2">Let output_string be an empty string.<a href="#section-4.2.6-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.6-2.3"> <p id="section-4.2.6-2.3.1">While input_string is not empty:<a href="#section-4.2.6-2.3.1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.6-2.3.2"> <li id="section-4.2.6-2.3.2.1">If the first character of input_string is not in tchar, ":", or "/", return output_string.<a href="#section-4.2.6-2.3.2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.6-2.3.2.2">Let char be the result of consuming the first character of input_string.<a href="#section-4.2.6-2.3.2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.6-2.3.2.3">Append char to output_string.<a href="#section-4.2.6-2.3.2.3" class="pilcrow">¶</a> </li> </ol> </li> <li id="section-4.2.6-2.4">Return output_string.<a href="#section-4.2.6-2.4" class="pilcrow">¶</a> </li> </ol> </section> </div> <div id="parse-binary"> <section id="section-4.2.7"> <h4 id="name-parsing-a-byte-sequence"> <a href="#section-4.2.7" class="section-number selfRef">4.2.7. </a><a href="#name-parsing-a-byte-sequence" class="section-name selfRef">Parsing a Byte Sequence</a> </h4> <p id="section-4.2.7-1">Given an ASCII string as input_string, return a Byte Sequence. input_string is modified to remove the parsed value.<a href="#section-4.2.7-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.7-2"> <li id="section-4.2.7-2.1">If the first character of input_string is not ":", fail parsing.<a href="#section-4.2.7-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.7-2.2">Discard the first character of input_string.<a href="#section-4.2.7-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.7-2.3">If there is not a ":" character before the end of input_string, fail parsing.<a href="#section-4.2.7-2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.7-2.4">Let b64_content be the result of consuming content of input_string up to but not including the first instance of the character ":".<a href="#section-4.2.7-2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.7-2.5">Consume the ":" character at the beginning of input_string.<a href="#section-4.2.7-2.5" class="pilcrow">¶</a> </li> <li id="section-4.2.7-2.6">If b64_content contains a character not included in ALPHA, DIGIT, "+", "/", and "=", fail parsing.<a href="#section-4.2.7-2.6" class="pilcrow">¶</a> </li> <li id="section-4.2.7-2.7">Let binary_content be the result of base64-decoding <span>[<a href="#RFC4648" class="xref">RFC4648</a>]</span> b64_content, synthesizing padding if necessary (note the requirements about recipient behavior below). If base64 decoding fails, parsing fails.<a href="#section-4.2.7-2.7" class="pilcrow">¶</a> </li> <li id="section-4.2.7-2.8">Return binary_content.<a href="#section-4.2.7-2.8" class="pilcrow">¶</a> </li> </ol> <p id="section-4.2.7-3">Because some implementations of base64 do not allow rejection of encoded data that is not properly "=" padded (see <span>[<a href="#RFC4648" class="xref">RFC4648</a>], <a href="https://www.rfc-editor.org/rfc/rfc4648#section-3.2" class="relref">Section 3.2</a></span>), parsers <span class="bcp14">SHOULD NOT</span> fail when "=" padding is not present, unless they cannot be configured to do so.<a href="#section-4.2.7-3" class="pilcrow">¶</a></p> <p id="section-4.2.7-4">Because some implementations of base64 do not allow rejection of encoded data that has non-zero pad bits (see <span>[<a href="#RFC4648" class="xref">RFC4648</a>], <a href="https://www.rfc-editor.org/rfc/rfc4648#section-3.5" class="relref">Section 3.5</a></span>), parsers <span class="bcp14">SHOULD NOT</span> fail when non-zero pad bits are present, unless they cannot be configured to do so.<a href="#section-4.2.7-4" class="pilcrow">¶</a></p> <p id="section-4.2.7-5">This specification does not relax the requirements in <span>[<a href="#RFC4648" class="xref">RFC4648</a>]</span>, Sections <a href="https://www.rfc-editor.org/rfc/rfc4648#section-3.1" class="relref">3.1</a> and <a href="https://www.rfc-editor.org/rfc/rfc4648#section-3.3" class="relref">3.3</a>; therefore, parsers <span class="bcp14">MUST</span> fail on characters outside the base64 alphabet and on line feeds in encoded data.<a href="#section-4.2.7-5" class="pilcrow">¶</a></p> </section> </div> <div id="parse-boolean"> <section id="section-4.2.8"> <h4 id="name-parsing-a-boolean"> <a href="#section-4.2.8" class="section-number selfRef">4.2.8. </a><a href="#name-parsing-a-boolean" class="section-name selfRef">Parsing a Boolean</a> </h4> <p id="section-4.2.8-1">Given an ASCII string as input_string, return a Boolean. input_string is modified to remove the parsed value.<a href="#section-4.2.8-1" class="pilcrow">¶</a></p> <ol start="1" type="1" class="normal type-1" id="section-4.2.8-2"> <li id="section-4.2.8-2.1">If the first character of input_string is not "?", fail parsing.<a href="#section-4.2.8-2.1" class="pilcrow">¶</a> </li> <li id="section-4.2.8-2.2">Discard the first character of input_string.<a href="#section-4.2.8-2.2" class="pilcrow">¶</a> </li> <li id="section-4.2.8-2.3">If the first character of input_string matches "1", discard the first character, and return true.<a href="#section-4.2.8-2.3" class="pilcrow">¶</a> </li> <li id="section-4.2.8-2.4">If the first character of input_string matches "0", discard the first character, and return false.<a href="#section-4.2.8-2.4" class="pilcrow">¶</a> </li> <li id="section-4.2.8-2.5">No value has matched; fail parsing.<a href="#section-4.2.8-2.5" class="pilcrow">¶</a> </li> </ol> </section> </div> </section> </div> </section> </div> <div id="iana-considerations"> <section id="section-5"> <h2 id="name-iana-considerations"> <a href="#section-5" class="section-number selfRef">5. </a><a href="#name-iana-considerations" class="section-name selfRef">IANA Considerations</a> </h2> <p id="section-5-1">This document has no IANA actions.<a href="#section-5-1" class="pilcrow">¶</a></p> </section> </div> <div id="security-considerations"> <section id="section-6"> <h2 id="name-security-considerations"> <a href="#section-6" class="section-number selfRef">6. </a><a href="#name-security-considerations" class="section-name selfRef">Security Considerations</a> </h2> <p id="section-6-1">The size of most types defined by Structured Fields is not limited; as a result, extremely large fields could be an attack vector (e.g., for resource consumption). Most HTTP implementations limit the sizes of individual fields as well as the overall header or trailer section size to mitigate such attacks.<a href="#section-6-1" class="pilcrow">¶</a></p> <p id="section-6-2">It is possible for parties with the ability to inject new HTTP fields to change the meaning of a Structured Field. In some circumstances, this will cause parsing to fail, but it is not possible to reliably fail in all such circumstances.<a href="#section-6-2" class="pilcrow">¶</a></p> </section> </div> <section id="section-7"> <h2 id="name-references"> <a href="#section-7" class="section-number selfRef">7. </a><a href="#name-references" class="section-name selfRef">References</a> </h2> <section id="section-7.1"> <h3 id="name-normative-references"> <a href="#section-7.1" class="section-number selfRef">7.1. </a><a href="#name-normative-references" class="section-name selfRef">Normative References</a> </h3> <dl class="references"> <dt id="RFC0020">[RFC0020]</dt> <dd> <span class="refAuthor">Cerf, V.</span>, <span class="refTitle">"ASCII format for network interchange"</span>, <span class="seriesInfo">STD 80</span>, <span class="seriesInfo">RFC 20</span>, <span class="seriesInfo">DOI 10.17487/RFC0020</span>, <time datetime="1969-10" class="refDate">October 1969</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc20">https://www.rfc-editor.org/info/rfc20</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC2119">[RFC2119]</dt> <dd> <span class="refAuthor">Bradner, S.</span>, <span class="refTitle">"Key words for use in RFCs to Indicate Requirement Levels"</span>, <span class="seriesInfo">BCP 14</span>, <span class="seriesInfo">RFC 2119</span>, <span class="seriesInfo">DOI 10.17487/RFC2119</span>, <time datetime="1997-03" class="refDate">March 1997</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc2119">https://www.rfc-editor.org/info/rfc2119</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC4648">[RFC4648]</dt> <dd> <span class="refAuthor">Josefsson, S.</span>, <span class="refTitle">"The Base16, Base32, and Base64 Data Encodings"</span>, <span class="seriesInfo">RFC 4648</span>, <span class="seriesInfo">DOI 10.17487/RFC4648</span>, <time datetime="2006-10" class="refDate">October 2006</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc4648">https://www.rfc-editor.org/info/rfc4648</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC5234">[RFC5234]</dt> <dd> <span class="refAuthor">Crocker, D., Ed.</span><span class="refAuthor"> and P. Overell</span>, <span class="refTitle">"Augmented BNF for Syntax Specifications: ABNF"</span>, <span class="seriesInfo">STD 68</span>, <span class="seriesInfo">RFC 5234</span>, <span class="seriesInfo">DOI 10.17487/RFC5234</span>, <time datetime="2008-01" class="refDate">January 2008</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc5234">https://www.rfc-editor.org/info/rfc5234</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC7230">[RFC7230]</dt> <dd> <span class="refAuthor">Fielding, R., Ed.</span><span class="refAuthor"> and J. Reschke, Ed.</span>, <span class="refTitle">"Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing"</span>, <span class="seriesInfo">RFC 7230</span>, <span class="seriesInfo">DOI 10.17487/RFC7230</span>, <time datetime="2014-06" class="refDate">June 2014</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc7230">https://www.rfc-editor.org/info/rfc7230</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC8174">[RFC8174]</dt> <dd> <span class="refAuthor">Leiba, B.</span>, <span class="refTitle">"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"</span>, <span class="seriesInfo">BCP 14</span>, <span class="seriesInfo">RFC 8174</span>, <span class="seriesInfo">DOI 10.17487/RFC8174</span>, <time datetime="2017-05" class="refDate">May 2017</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8174">https://www.rfc-editor.org/info/rfc8174</a>&gt;</span>. </dd> <dd class="break"></dd> </dl> </section> <section id="section-7.2"> <h3 id="name-informative-references"> <a href="#section-7.2" class="section-number selfRef">7.2. </a><a href="#name-informative-references" class="section-name selfRef">Informative References</a> </h3> <dl class="references"> <dt id="IEEE754">[IEEE754]</dt> <dd> <span class="refAuthor">IEEE</span>, <span class="refTitle">"IEEE Standard for Floating-Point Arithmetic"</span>, <span class="seriesInfo">DOI 10.1109/IEEESTD.2019.8766229</span>, <span class="seriesInfo">IEEE 754-2019</span>, <time datetime="2019-07" class="refDate">July 2019</time>, <span>&lt;<a href="https://ieeexplore.ieee.org/document/8766229">https://ieeexplore.ieee.org/document/8766229</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC7231">[RFC7231]</dt> <dd> <span class="refAuthor">Fielding, R., Ed.</span><span class="refAuthor"> and J. Reschke, Ed.</span>, <span class="refTitle">"Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content"</span>, <span class="seriesInfo">RFC 7231</span>, <span class="seriesInfo">DOI 10.17487/RFC7231</span>, <time datetime="2014-06" class="refDate">June 2014</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc7231">https://www.rfc-editor.org/info/rfc7231</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC7493">[RFC7493]</dt> <dd> <span class="refAuthor">Bray, T., Ed.</span>, <span class="refTitle">"The I-JSON Message Format"</span>, <span class="seriesInfo">RFC 7493</span>, <span class="seriesInfo">DOI 10.17487/RFC7493</span>, <time datetime="2015-03" class="refDate">March 2015</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc7493">https://www.rfc-editor.org/info/rfc7493</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC7540">[RFC7540]</dt> <dd> <span class="refAuthor">Belshe, M.</span><span class="refAuthor">, Peon, R.</span><span class="refAuthor">, and M. Thomson, Ed.</span>, <span class="refTitle">"Hypertext Transfer Protocol Version 2 (HTTP/2)"</span>, <span class="seriesInfo">RFC 7540</span>, <span class="seriesInfo">DOI 10.17487/RFC7540</span>, <time datetime="2015-05" class="refDate">May 2015</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc7540">https://www.rfc-editor.org/info/rfc7540</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC7541">[RFC7541]</dt> <dd> <span class="refAuthor">Peon, R.</span><span class="refAuthor"> and H. Ruellan</span>, <span class="refTitle">"HPACK: Header Compression for HTTP/2"</span>, <span class="seriesInfo">RFC 7541</span>, <span class="seriesInfo">DOI 10.17487/RFC7541</span>, <time datetime="2015-05" class="refDate">May 2015</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc7541">https://www.rfc-editor.org/info/rfc7541</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="RFC8259">[RFC8259]</dt> <dd> <span class="refAuthor">Bray, T., Ed.</span>, <span class="refTitle">"The JavaScript Object Notation (JSON) Data Interchange Format"</span>, <span class="seriesInfo">STD 90</span>, <span class="seriesInfo">RFC 8259</span>, <span class="seriesInfo">DOI 10.17487/RFC8259</span>, <time datetime="2017-12" class="refDate">December 2017</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8259">https://www.rfc-editor.org/info/rfc8259</a>&gt;</span>. </dd> <dd class="break"></dd> <dt id="STD63">[STD63]</dt> <dd> <span class="refAuthor">Yergeau, F.</span>, <span class="refTitle">"UTF-8, a transformation format of ISO 10646"</span>, <span class="seriesInfo">STD 63</span>, <span class="seriesInfo">RFC 3629</span>, <time datetime="2003-11" class="refDate">November 2003</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/std63">https://www.rfc-editor.org/info/std63</a>&gt;</span>. </dd> <dd class="break"></dd> </dl> </section> </section> <div id="faq"> <section id="section-appendix.a"> <h2 id="name-frequently-asked-questions"> <a href="#section-appendix.a" class="section-number selfRef">Appendix A. </a><a href="#name-frequently-asked-questions" class="section-name selfRef">Frequently Asked Questions</a> </h2> <div id="why-not-json"> <section id="section-a.1"> <h2 id="name-why-not-json"> <a href="#section-a.1" class="section-number selfRef">A.1. </a><a href="#name-why-not-json" class="section-name selfRef">Why Not JSON?</a> </h2> <p id="section-a.1-1">Earlier proposals for Structured Fields were based upon JSON <span>[<a href="#RFC8259" class="xref">RFC8259</a>]</span>. However, constraining its use to make it suitable for HTTP header fields required senders and recipients to implement specific additional handling.<a href="#section-a.1-1" class="pilcrow">¶</a></p> <p id="section-a.1-2">For example, JSON has specification issues around large numbers and objects with duplicate members. Although advice for avoiding these issues is available (e.g., <span>[<a href="#RFC7493" class="xref">RFC7493</a>]</span>), it cannot be relied upon.<a href="#section-a.1-2" class="pilcrow">¶</a></p> <p id="section-a.1-3">Likewise, JSON strings are by default Unicode strings, which have a number of potential interoperability issues (e.g., in comparison). Although implementers can be advised to avoid non-ASCII content where unnecessary, this is difficult to enforce.<a href="#section-a.1-3" class="pilcrow">¶</a></p> <p id="section-a.1-4">Another example is JSON's ability to nest content to arbitrary depths. Since the resulting memory commitment might be unsuitable (e.g., in embedded and other limited server deployments), it's necessary to limit it in some fashion; however, existing JSON implementations have no such limits, and even if a limit is specified, it's likely that some field definition will find a need to violate it.<a href="#section-a.1-4" class="pilcrow">¶</a></p> <p id="section-a.1-5">Because of JSON's broad adoption and implementation, it is difficult to impose such additional constraints across all implementations; some deployments would fail to enforce them, thereby harming interoperability. In short, if it looks like JSON, people will be tempted to use a JSON parser/serializer on field values.<a href="#section-a.1-5" class="pilcrow">¶</a></p> <p id="section-a.1-6">Since a major goal for Structured Fields is to improve interoperability and simplify implementation, these concerns led to a format that requires a dedicated parser and serializer.<a href="#section-a.1-6" class="pilcrow">¶</a></p> <p id="section-a.1-7">Additionally, there were widely shared feelings that JSON doesn't "look right" in HTTP fields.<a href="#section-a.1-7" class="pilcrow">¶</a></p> </section> </div> </section> </div> <div id="implementation-notes"> <section id="section-appendix.b"> <h2 id="name-implementation-notes"> <a href="#section-appendix.b" class="section-number selfRef">Appendix B. </a><a href="#name-implementation-notes" class="section-name selfRef">Implementation Notes</a> </h2> <p id="section-appendix.b-1">A generic implementation of this specification should expose the top-level serialize (<a href="#text-serialize" class="xref">Section 4.1</a>) and parse (<a href="#text-parse" class="xref">Section 4.2</a>) functions. They need not be functions; for example, it could be implemented as an object, with methods for each of the different top-level types.<a href="#section-appendix.b-1" class="pilcrow">¶</a></p> <p id="section-appendix.b-2">For interoperability, it's important that generic implementations be complete and follow the algorithms closely; see <a href="#strict" class="xref">Section 1.1</a>. To aid this, a common test suite is being maintained by the community at <span>&lt;<a href="https://github.com/httpwg/structured-field-tests">https://github.com/httpwg/structured-field-tests</a>&gt;</span>.<a href="#section-appendix.b-2" class="pilcrow">¶</a></p> <p id="section-appendix.b-3">Implementers should note that Dictionaries and Parameters are order-preserving maps. Some fields may not convey meaning in the ordering of these data types, but it should still be exposed so that it will be available to applications that need to use it.<a href="#section-appendix.b-3" class="pilcrow">¶</a></p> <p id="section-appendix.b-4">Likewise, implementations should note that it's important to preserve the distinction between Tokens and Strings. While most programming languages have native types that map to the other types well, it may be necessary to create a wrapper "token" object or use a parameter on functions to assure that these types remain separate.<a href="#section-appendix.b-4" class="pilcrow">¶</a></p> <p id="section-appendix.b-5">The serialization algorithm is defined in a way that it is not strictly limited to the data types defined in <a href="#types" class="xref">Section 3</a> in every case. For example, Decimals are designed to take broader input and round to allowed values.<a href="#section-appendix.b-5" class="pilcrow">¶</a></p> <p id="section-appendix.b-6">Implementations are allowed to limit the size of different structures, subject to the minimums defined for each type. When a structure exceeds an implementation limit, that structure fails parsing or serialization.<a href="#section-appendix.b-6" class="pilcrow">¶</a></p> </section> </div> <div id="acknowledgements"> <section id="section-appendix.c"> <h2 id="name-acknowledgements"> <a href="#name-acknowledgements" class="section-name selfRef">Acknowledgements</a> </h2> <p id="section-appendix.c-1">Many thanks to <span class="contact-name">Matthew Kerwin</span> for his detailed feedback and careful consideration during the development of this specification.<a href="#section-appendix.c-1" class="pilcrow">¶</a></p> <p id="section-appendix.c-2">Thanks also to <span class="contact-name">Ian Clelland</span>, <span class="contact-name">Roy Fielding</span>, <span class="contact-name">Anne van Kesteren</span>, <span class="contact-name">Kazuho Oku</span>, <span class="contact-name">Evert Pot</span>, <span class="contact-name">Julian Reschke</span>, <span class="contact-name">Martin Thomson</span>, <span class="contact-name">Mike West</span>, and <span class="contact-name">Jeffrey Yasskin</span> for their contributions.<a href="#section-appendix.c-2" class="pilcrow">¶</a></p> </section> </div> <div id="authors-addresses"> <section id="section-appendix.d"> <h2 id="name-authors-addresses"> <a href="#name-authors-addresses" class="section-name selfRef">Authors' Addresses</a> </h2> <address class="vcard"> <div dir="auto" class="left"><span class="fn nameRole">Mark Nottingham</span></div> <div dir="auto" class="left"><span class="org">Fastly</span></div> <div dir="auto" class="left"> <span class="locality">Prahran</span> <span class="region">VIC</span> </div> <div dir="auto" class="left"><span class="country-name">Australia</span></div> <div class="email"> <span>Email:</span> <a href="mailto:mnot@mnot.net" class="email">mnot@mnot.net</a> </div> <div class="url"> <span>URI:</span> <a href="https://www.mnot.net/" class="url">https://www.mnot.net/</a> </div> </address> <address class="vcard"> <div dir="auto" class="left"><span class="fn nameRole">Poul-Henning Kamp</span></div> <div dir="auto" class="left"><span class="org">The Varnish Cache Project</span></div> <div class="email"> <span>Email:</span> <a href="mailto:phk@varnish-cache.org" class="email">phk@varnish-cache.org</a> </div> </address> </section> </div> <script>const toc = document.getElementById("toc"); toc.querySelector("h2").addEventListener("click", e => { toc.classList.toggle("active"); }); toc.querySelector("nav").addEventListener("click", e => { toc.classList.remove("active"); }); </script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10