Skip to main content
Module

x/opine/docs/interfaces/_types_.request.html

Fast, minimalist web framework for Deno ported from ExpressJS.
Go to Latest
File
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
<!doctype html><html class="default no-js"><head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Request | </title> <meta name="description" content="Documentation for "> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"></head><body><header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title"></a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="../modules/_types_.html">&quot;types&quot;</a> </li> <li> <a href="_types_.request.html">Request</a> </li> </ul> <h1>Interface Request&lt;P, ResBody, ReqQuery&gt;</h1> </div> </div></header><div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-comment"> <div class="tsd-comment tsd-typography"> <dl class="tsd-comment-tags"> <dt>see</dt> <dd><p><a href="https://expressjs.com/en/api.html#req.params">https://expressjs.com/en/api.html#req.params</a></p> </dd> <dt>example</dt> <dd><pre><code>app.get(<span class="hljs-string">&#x27;/user/:id&#x27;</span>, <span class="hljs-function"><span class="hljs-params">(req, res)</span> =&gt;</span> res.send(req.params.id)); <span class="hljs-regexp">//</span> implicitly `<span class="javascript">ParamsDictionary</span>`app.get&lt;ParamsArray&gt;(<span class="hljs-regexp">/user\/(.*)/</span>, <span class="hljs-function"><span class="hljs-params">(req, res)</span> =&gt;</span> res.send(req.params[<span class="hljs-number">0</span>]));app.get&lt;ParamsArray&gt;(<span class="hljs-string">&#x27;/user/*&#x27;</span>, <span class="hljs-function"><span class="hljs-params">(req, res)</span> =&gt;</span> res.send(req.params[<span class="hljs-number">0</span>]));</code></pre></dd> </dl> </div> </section> <section class="tsd-panel tsd-type-parameters"> <h3>Type parameters</h3> <ul class="tsd-type-parameters"> <li> <h4>P<span class="tsd-signature-symbol">: </span><a href="../modules/_types_.html#params" class="tsd-signature-type">Params</a></h4> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>For most requests, this should be <code>ParamsDictionary</code>, but if you&#39;re using this in a route handler for a route that uses a <code>RegExp</code> or a wildcard <code>string</code> path (e.g. <code>&#39;/user/*&#39;</code>), then <code>req.params</code> will be an array, in which case you should use <code>ParamsArray</code> instead.</p> </div> </div> </li> <li> <h4>ResBody</h4> </li> <li> <h4>ReqQuery</h4> </li> </ul> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="tsd-signature-type">any</span> </li> <li> <a href="_types_.__global.opine.request.html" class="tsd-signature-type">Request</a> <ul class="tsd-hierarchy"> <li> <span class="target">Request</span> </li> </ul> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#_parsedoriginalurl" class="tsd-kind-icon">_parsed<wbr>Original<wbr>Url</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#_parsedurl" class="tsd-kind-icon">_parsed<wbr>Url</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#app" class="tsd-kind-icon">app</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#baseurl" class="tsd-kind-icon">base<wbr>Url</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#body" class="tsd-kind-icon">body</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#conn" class="tsd-kind-icon">conn</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#fresh" class="tsd-kind-icon">fresh</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#get" class="tsd-kind-icon">get</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#headers" class="tsd-kind-icon">headers</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#hostname" class="tsd-kind-icon">hostname</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#method" class="tsd-kind-icon">method</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#next" class="tsd-kind-icon">next</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#originalurl" class="tsd-kind-icon">original<wbr>Url</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#params" class="tsd-kind-icon">params</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#parsedbody" class="tsd-kind-icon">parsed<wbr>Body</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#path" class="tsd-kind-icon">path</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#proto" class="tsd-kind-icon">proto</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#protomajor" class="tsd-kind-icon">proto<wbr>Major</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#protominor" class="tsd-kind-icon">proto<wbr>Minor</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#protocol" class="tsd-kind-icon">protocol</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#query" class="tsd-kind-icon">query</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#res" class="tsd-kind-icon">res</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#route" class="tsd-kind-icon">route</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#secure" class="tsd-kind-icon">secure</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#stale" class="tsd-kind-icon">stale</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#subdomains" class="tsd-kind-icon">subdomains</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#url" class="tsd-kind-icon">url</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_types_.request.html#xhr" class="tsd-kind-icon">xhr</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="_types_.request.html#accepts" class="tsd-kind-icon">accepts</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="_types_.request.html#acceptscharsets" class="tsd-kind-icon">accepts<wbr>Charsets</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="_types_.request.html#acceptsencodings" class="tsd-kind-icon">accepts<wbr>Encodings</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="_types_.request.html#acceptslanguages" class="tsd-kind-icon">accepts<wbr>Languages</a></li> <li class="tsd-kind-method tsd-parent-kind-interface"><a href="_types_.request.html#is" class="tsd-kind-icon">is</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="_parsedoriginalurl" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagOptional">Optional</span> _parsed<wbr>Original<wbr>Url</h3> <div class="tsd-signature tsd-kind-icon">_parsed<wbr>Original<wbr>Url<span class="tsd-signature-symbol">:</span> <a href="../modules/_types_.html#parsedurl" class="tsd-signature-type">ParsedURL</a></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L504">types.ts:504</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>After calling <code>originalUrl</code> on the request object, the original url is memoization by storing onto the <code>_parsedOriginalUrl</code> property.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="_parsedurl" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagOptional">Optional</span> _parsed<wbr>Url</h3> <div class="tsd-signature tsd-kind-icon">_parsed<wbr>Url<span class="tsd-signature-symbol">:</span> <a href="../modules/_types_.html#parsedurl" class="tsd-signature-type">ParsedURL</a></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L498">types.ts:498</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>After calling <code>parseUrl</code> on the request object, the parsed url is memoization by storing onto the <code>_parsedUrl</code> property.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="app" class="tsd-anchor"></a> <h3>app</h3> <div class="tsd-signature tsd-kind-icon">app<span class="tsd-signature-symbol">:</span> <a href="_types_.application.html" class="tsd-signature-type">Application</a></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L478">types.ts:478</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="baseurl" class="tsd-anchor"></a> <h3>base<wbr>Url</h3> <div class="tsd-signature tsd-kind-icon">base<wbr>Url<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L470">types.ts:470</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="body" class="tsd-anchor"></a> <h3>body</h3> <div class="tsd-signature tsd-kind-icon">body<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Deno.Reader</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L456">types.ts:456</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Body of request.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="conn" class="tsd-anchor"></a> <h3>conn</h3> <div class="tsd-signature tsd-kind-icon">conn<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Deno.Conn</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L476">types.ts:476</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="fresh" class="tsd-anchor"></a> <h3>fresh</h3> <div class="tsd-signature tsd-kind-icon">fresh<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L439">types.ts:439</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Check if the request is fresh, aka Last-Modified and/or the ETag still match.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="get" class="tsd-anchor"></a> <h3>get</h3> <div class="tsd-signature tsd-kind-icon">get<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L369">types.ts:369</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Return request header.</p> </div> <p>The <code>Referrer</code> header field is special-cased, both <code>Referrer</code> and <code>Referer</code> are interchangeable.</p> <p>Examples:</p> <pre><code>req.get(<span class="hljs-string">&#x27;Content-Type&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;text/plain&quot;</span>
req.get(<span class="hljs-string">&#x27;content-type&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;text/plain&quot;</span>
req.get(<span class="hljs-string">&#x27;Something&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; undefined</code></pre> </div> <div class="tsd-type-declaration"> <h4>Type declaration</h4> <ul class="tsd-parameters"> <li class="tsd-parameter-signature"> <ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property"> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>name: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4> </li> </ul> </li> </ul> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="headers" class="tsd-anchor"></a> <h3>headers</h3> <div class="tsd-signature tsd-kind-icon">headers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Headers</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L475">types.ts:475</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="hostname" class="tsd-anchor"></a> <h3>hostname</h3> <div class="tsd-signature tsd-kind-icon">hostname<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L432">types.ts:432</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Parse the &quot;Host&quot; header field hostname.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="method" class="tsd-anchor"></a> <h3>method</h3> <div class="tsd-signature tsd-kind-icon">method<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L458">types.ts:458</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="next" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagOptional">Optional</span> next</h3> <div class="tsd-signature tsd-kind-icon">next<span class="tsd-signature-symbol">:</span> <a href="_types_.nextfunction.html" class="tsd-signature-type">NextFunction</a></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L485">types.ts:485</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="originalurl" class="tsd-anchor"></a> <h3>original<wbr>Url</h3> <div class="tsd-signature tsd-kind-icon">original<wbr>Url<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L466">types.ts:466</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="params" class="tsd-anchor"></a> <h3>params</h3> <div class="tsd-signature tsd-kind-icon">params<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">P</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L460">types.ts:460</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="parsedbody" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagOptional">Optional</span> parsed<wbr>Body</h3> <div class="tsd-signature tsd-kind-icon">parsed<wbr>Body<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L492">types.ts:492</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>After body parsers, Request will contain parsedBody property containing the parsed body. See: opine/src/middleware/bodyParser/</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="path" class="tsd-anchor"></a> <h3>path</h3> <div class="tsd-signature tsd-kind-icon">path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L427">types.ts:427</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Returns the pathname of the URL.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="proto" class="tsd-anchor"></a> <h3>proto</h3> <div class="tsd-signature tsd-kind-icon">proto<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L472">types.ts:472</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="protomajor" class="tsd-anchor"></a> <h3>proto<wbr>Major</h3> <div class="tsd-signature tsd-kind-icon">proto<wbr>Major<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L474">types.ts:474</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="protominor" class="tsd-anchor"></a> <h3>proto<wbr>Minor</h3> <div class="tsd-signature tsd-kind-icon">proto<wbr>Minor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L473">types.ts:473</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="protocol" class="tsd-anchor"></a> <h3>protocol</h3> <div class="tsd-signature tsd-kind-icon">protocol<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L402">types.ts:402</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Return the protocol string &quot;http&quot; or &quot;https&quot; when requested with TLS. When the &quot;trust proxy&quot; setting is enabled the &quot;X-Forwarded-Proto&quot; header field will be trusted. If you&#39;re running behind a reverse proxy that supplies https for you this may be enabled.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="query" class="tsd-anchor"></a> <h3>query</h3> <div class="tsd-signature tsd-kind-icon">query<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ReqQuery</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L462">types.ts:462</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="res" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagOptional">Optional</span> res</h3> <div class="tsd-signature tsd-kind-icon">res<span class="tsd-signature-symbol">:</span> <a href="_types_.response.html" class="tsd-signature-type">Response</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">ResBody</span><span class="tsd-signature-symbol">&gt;</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L484">types.ts:484</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>After middleware.init executed, Request will contain res and next properties. See: opine/src/middleware/init.ts</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="route" class="tsd-anchor"></a> <h3>route</h3> <div class="tsd-signature tsd-kind-icon">route<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L464">types.ts:464</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="secure" class="tsd-anchor"></a> <h3>secure</h3> <div class="tsd-signature tsd-kind-icon">secure<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L409">types.ts:409</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Short-hand for:</p> </div> <p> req.protocol == &#39;https&#39;</p> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="stale" class="tsd-anchor"></a> <h3>stale</h3> <div class="tsd-signature tsd-kind-icon">stale<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L446">types.ts:446</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Check if the request is stale, aka &quot;Last-Modified&quot; and / or the &quot;ETag&quot; for the resource has changed.</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="subdomains" class="tsd-anchor"></a> <h3>subdomains</h3> <div class="tsd-signature tsd-kind-icon">subdomains<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L422">types.ts:422</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Return subdomains as an array.</p> </div> <p>Subdomains are the dot-separated parts of the host before the main domain of the app. By default, the domain of the app is assumed to be the last two parts of the host. This can be changed by setting &quot;subdomain offset&quot;.</p> <p>For example, if the domain is &quot;deno.dinosaurs.example.com&quot;: If &quot;subdomain offset&quot; is not set, req.subdomains is <code>[&quot;dinosaurs&quot;, &quot;deno&quot;]</code>. If &quot;subdomain offset&quot; is 3, req.subdomains is <code>[&quot;deno&quot;]</code>.</p> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="url" class="tsd-anchor"></a> <h3>url</h3> <div class="tsd-signature tsd-kind-icon">url<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L468">types.ts:468</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="xhr" class="tsd-anchor"></a> <h3>xhr</h3> <div class="tsd-signature tsd-kind-icon">xhr<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L451">types.ts:451</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Check if the request was an <em>XMLHttpRequest</em>.</p> </div> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="accepts" class="tsd-anchor"></a> <h3>accepts</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">accepts<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L311">types.ts:311</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Check if the given <code>type(s)</code> is acceptable, returning the best match when true, otherwise <code>undefined</code>, in which case you should respond with 406 &quot;Not Acceptable&quot;.</p> </div> <p>The <code>type</code> value may be a single mime type string such as &quot;application/json&quot;, the extension name such as &quot;json&quot;, a comma-delimited list such as &quot;json, html, text/plain&quot;, or an array <code>[&quot;json&quot;, &quot;html&quot;, &quot;text/plain&quot;]</code>. When a list or array is given the <em>best</em> match, if any is returned.</p> <p>Examples:</p> <pre><code><span class="hljs-regexp">//</span> Accept: text/htmlreq.accepts(<span class="hljs-string">&#x27;html&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;html&quot;</span>
<span class="hljs-regexp">//</span> Accept: text<span class="hljs-regexp">/*, application/</span>jsonreq.accepts(<span class="hljs-string">&#x27;html&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;html&quot;</span>req.accepts(<span class="hljs-string">&#x27;text/html&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;text/html&quot;</span>req.accepts(<span class="hljs-string">&#x27;json, text&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;json&quot;</span>req.accepts(<span class="hljs-string">&#x27;application/json&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;application/json&quot;</span>
<span class="hljs-regexp">//</span> Accept: text<span class="hljs-regexp">/*, application/</span>jsonreq.accepts(<span class="hljs-string">&#x27;image/png&#x27;</span>);req.accepts(<span class="hljs-string">&#x27;png&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; undefined
<span class="hljs-regexp">//</span> Accept: text<span class="hljs-regexp">/*;q=.5, application/</span>jsonreq.accepts([<span class="hljs-string">&#x27;html&#x27;</span>, <span class="hljs-string">&#x27;json&#x27;</span>]);req.accepts(<span class="hljs-string">&#x27;html, json&#x27;</span>);<span class="hljs-regexp">//</span> =&gt; <span class="hljs-string">&quot;json&quot;</span></code></pre> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L312">types.ts:312</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>type: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L313">types.ts:313</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>type: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L314">types.ts:314</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>type: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="acceptscharsets" class="tsd-anchor"></a> <h3>accepts<wbr>Charsets</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Charsets<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Charsets<span class="tsd-signature-symbol">(</span>charset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Charsets<span class="tsd-signature-symbol">(</span>charset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Charsets<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>charset<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L323">types.ts:323</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Returns the first accepted charset of the specified character sets, based on the request&#39;s Accept-Charset HTTP header field. If none of the specified charsets is accepted, returns false.</p> </div> <p>For more information, or if you have issues or concerns, see accepts.</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L324">types.ts:324</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>charset: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L325">types.ts:325</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>charset: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L326">types.ts:326</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>charset: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="acceptsencodings" class="tsd-anchor"></a> <h3>accepts<wbr>Encodings</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Encodings<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Encodings<span class="tsd-signature-symbol">(</span>encoding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Encodings<span class="tsd-signature-symbol">(</span>encoding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Encodings<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>encoding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L335">types.ts:335</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Returns the first accepted encoding of the specified encodings, based on the request&#39;s Accept-Encoding HTTP header field. If none of the specified encodings is accepted, returns false.</p> </div> <p>For more information, or if you have issues or concerns, see accepts.</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L336">types.ts:336</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>encoding: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L337">types.ts:337</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>encoding: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L338">types.ts:338</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>encoding: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="acceptslanguages" class="tsd-anchor"></a> <h3>accepts<wbr>Languages</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Languages<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Languages<span class="tsd-signature-symbol">(</span>lang<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Languages<span class="tsd-signature-symbol">(</span>lang<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> <li class="tsd-signature tsd-kind-icon">accepts<wbr>Languages<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>lang<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L347">types.ts:347</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Returns the first accepted language of the specified languages, based on the request&#39;s Accept-Language HTTP header field. If none of the specified languages is accepted, returns false.</p> </div> <p>For more information, or if you have issues or concerns, see accepts.</p> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L348">types.ts:348</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>lang: <span class="tsd-signature-type">string</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L349">types.ts:349</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>lang: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L350">types.ts:350</a></li> </ul> </aside> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>lang: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"> <a name="is" class="tsd-anchor"></a> <h3>is</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"> <li class="tsd-signature tsd-kind-icon">is<span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/asos-craigmorten/opine/blob/40cda3b/src/types.ts#L392">types.ts:392</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Check if the incoming request contains the &quot;Content-Type&quot; header field, and it contains the give mime <code>type</code>.</p> </div> <p>Examples:</p> <pre><code> // <span class="hljs-keyword">With</span> Content-<span class="hljs-keyword">Type</span>: <span class="hljs-type">text</span>/html; charset=utf<span class="hljs-number">-8</span> req.<span class="hljs-keyword">is</span>(<span class="hljs-string">&#x27;html&#x27;</span>); req.<span class="hljs-keyword">is</span>(<span class="hljs-string">&#x27;text/html&#x27;</span>); req.<span class="hljs-keyword">is</span>(<span class="hljs-string">&#x27;text/*&#x27;</span>); // =&gt; <span class="hljs-keyword">true</span>
// <span class="hljs-keyword">When</span> Content-<span class="hljs-keyword">Type</span> <span class="hljs-keyword">is</span> application/<span class="hljs-type">json</span> req.<span class="hljs-keyword">is</span>(<span class="hljs-string">&#x27;json&#x27;</span>); req.<span class="hljs-keyword">is</span>(<span class="hljs-string">&#x27;application/json&#x27;</span>); req.<span class="hljs-keyword">is</span>(<span class="hljs-string">&#x27;application/*&#x27;</span>); // =&gt; <span class="hljs-keyword">true</span>
req.<span class="hljs-keyword">is</span>(<span class="hljs-string">&#x27;html&#x27;</span>); // =&gt; <span class="hljs-keyword">false</span></code></pre> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>type: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h4> </li> </ul> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../globals.html"><em>Globals</em></a> </li> <li class="current tsd-kind-module"> <a href="../modules/_types_.html">&quot;types&quot;</a> <ul> <li class=" tsd-kind-namespace tsd-parent-kind-module tsd-is-not-exported"> <a href="../modules/_types_.__global.html">__global</a> </li> </ul> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.application.html" class="tsd-kind-icon">Application</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.byterange.html" class="tsd-kind-icon">Byte<wbr>Range</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.cookie.html" class="tsd-kind-icon">Cookie</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.dictionary.html" class="tsd-kind-icon">Dictionary</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.handler.html" class="tsd-kind-icon">Handler</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.iroute.html" class="tsd-kind-icon">IRoute</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.irouter.html" class="tsd-kind-icon">IRouter</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.irouterhandler.html" class="tsd-kind-icon">IRouter<wbr>Handler</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.iroutermatcher.html" class="tsd-kind-icon">IRouter<wbr>Matcher</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.mediatype.html" class="tsd-kind-icon">Media<wbr>Type</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.nextfunction.html" class="tsd-kind-icon">Next<wbr>Function</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.opine.html" class="tsd-kind-icon">Opine</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.paramsdictionary.html" class="tsd-kind-icon">Params<wbr>Dictionary</a> </li> </ul> <ul class="current"> <li class="current tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.request.html" class="tsd-kind-icon">Request</a> <ul> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#_parsedoriginalurl" class="tsd-kind-icon">_parsed<wbr>Original<wbr>Url</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#_parsedurl" class="tsd-kind-icon">_parsed<wbr>Url</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#app" class="tsd-kind-icon">app</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#baseurl" class="tsd-kind-icon">base<wbr>Url</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#body" class="tsd-kind-icon">body</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#conn" class="tsd-kind-icon">conn</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#fresh" class="tsd-kind-icon">fresh</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#get" class="tsd-kind-icon">get</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#headers" class="tsd-kind-icon">headers</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#hostname" class="tsd-kind-icon">hostname</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#method" class="tsd-kind-icon">method</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#next" class="tsd-kind-icon">next</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#originalurl" class="tsd-kind-icon">original<wbr>Url</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#params" class="tsd-kind-icon">params</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#parsedbody" class="tsd-kind-icon">parsed<wbr>Body</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#path" class="tsd-kind-icon">path</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#proto" class="tsd-kind-icon">proto</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#protomajor" class="tsd-kind-icon">proto<wbr>Major</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#protominor" class="tsd-kind-icon">proto<wbr>Minor</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#protocol" class="tsd-kind-icon">protocol</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#query" class="tsd-kind-icon">query</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#res" class="tsd-kind-icon">res</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#route" class="tsd-kind-icon">route</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#secure" class="tsd-kind-icon">secure</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#stale" class="tsd-kind-icon">stale</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#subdomains" class="tsd-kind-icon">subdomains</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#url" class="tsd-kind-icon">url</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_types_.request.html#xhr" class="tsd-kind-icon">xhr</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="_types_.request.html#accepts" class="tsd-kind-icon">accepts</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="_types_.request.html#acceptscharsets" class="tsd-kind-icon">accepts<wbr>Charsets</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="_types_.request.html#acceptsencodings" class="tsd-kind-icon">accepts<wbr>Encodings</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="_types_.request.html#acceptslanguages" class="tsd-kind-icon">accepts<wbr>Languages</a> </li> <li class=" tsd-kind-method tsd-parent-kind-interface"> <a href="_types_.request.html#is" class="tsd-kind-icon">is</a> </li> </ul> </li> </ul> <ul class="after-current"> <li class=" tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.requesthandler.html" class="tsd-kind-icon">Request<wbr>Handler</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.requestranges.html" class="tsd-kind-icon">Request<wbr>Ranges</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.response.html" class="tsd-kind-icon">Response</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module tsd-has-type-parameter"> <a href="_types_.router.html" class="tsd-kind-icon">Router</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.routerconstructor.html" class="tsd-kind-icon">Router<wbr>Constructor</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-module"> <a href="_types_.routeroptions.html" class="tsd-kind-icon">Router<wbr>Options</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter"> <a href="../modules/_types_.html#applicationrequesthandler" class="tsd-kind-icon">Application<wbr>Request<wbr>Handler</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#denoresponsebody" class="tsd-kind-icon">Deno<wbr>Response<wbr>Body</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#errback" class="tsd-kind-icon">Errback</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter"> <a href="../modules/_types_.html#errorrequesthandler" class="tsd-kind-icon">Error<wbr>Request<wbr>Handler</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#params" class="tsd-kind-icon">Params</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#paramsarray" class="tsd-kind-icon">Params<wbr>Array</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#parsedurl" class="tsd-kind-icon">ParsedURL</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#pathparams" class="tsd-kind-icon">Path<wbr>Params</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter"> <a href="../modules/_types_.html#requesthandlerparams" class="tsd-kind-icon">Request<wbr>Handler<wbr>Params</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#requestparamhandler" class="tsd-kind-icon">Request<wbr>Param<wbr>Handler</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module"> <a href="../modules/_types_.html#responsebody" class="tsd-kind-icon">Response<wbr>Body</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter"> <a href="../modules/_types_.html#send" class="tsd-kind-icon">Send</a> </li> </ul> </nav> </div> </div></div><footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> </ul> </div> </div></footer><div class="container tsd-generator"> <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/js/main.js"></script><script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script></body></html>