see

  https://expressjs.com/en/api.html#req.params

example

      app.get('/user/:id', (req, res) => res.send(req.params.id)); // implicitly `ParamsDictionary`
      app.get<ParamsArray>(/user\/(.*)/, (req, res) => res.send(req.params[0]));
      app.get<ParamsArray>('/user/*', (req, res) => res.send(req.params[0]));

### Type parameters

- #### P: Params = ParamsDictionary

  For most requests, this should be `ParamsDictionary`, but if you're using this in a route handler for a route that uses a `RegExp` or a wildcard `string` path (e.g. `'/user/*'`), then `req.params` will be an array, in which case you should use `ParamsArray` instead.

- #### ResBody = any

- #### ReqQuery = any

### Hierarchy

- Request
  - OpineRequest

### Implemented by

- WrappedRequest

## Index

### Properties

- _parsedBody
- _parsedOriginalUrl
- _parsedUrl
- app
- baseUrl
- body
- conn
- finalResponse
- fresh
- get
- headers
- hostname
- ip
- ips
- method
- next
- originalUrl
- param
- params
- parsedBody
- path
- proto
- protocol
- query
- raw
- res
- route
- secure
- stale
- subdomains
- url
- xhr

### Methods

- accepts
- acceptsCharsets
- acceptsEncodings
- acceptsLanguages
- is
- range
- respond
- upgrade

## Properties

### Optional _parsedBody

_parsedBody: boolean

- Defined in home/runner/work/opine/opine/src/types.ts:596

After body parsers, OpineRequest will contain `_parsedBody` boolean property dictating that the body has been parsed. See: opine/src/middleware/bodyParser/

### Optional _parsedOriginalUrl

_parsedOriginalUrl: ParsedURL

- Defined in home/runner/work/opine/opine/src/types.ts:615

After calling `originalUrl` on the request object, the original url is memoization by storing onto the `_parsedOriginalUrl` property.

### Optional _parsedUrl

_parsedUrl: ParsedURL

- Defined in home/runner/work/opine/opine/src/types.ts:609

After calling `parseUrl` on the request object, the parsed url is memoization by storing onto the `_parsedUrl` property.

### app

app: Application

- Defined in home/runner/work/opine/opine/src/types.ts:582

### baseUrl

baseUrl: string

- Defined in home/runner/work/opine/opine/src/types.ts:575

### body

body: any

- Defined in home/runner/work/opine/opine/src/types.ts:556

Body of request.

If the body has been passed such that a `parsedBody` property is defined, this returns the `parsedBody` value.

To always get the raw body value, use the `raw` property.

### conn

conn: ConnInfo

- Defined in home/runner/work/opine/opine/src/types.ts:580

### finalResponse

finalResponse: Promise<Response>

- Defined in home/runner/work/opine/opine/src/types.ts:628

Returns a promise that resolves to the response to the request.

### fresh

fresh: boolean

- Defined in home/runner/work/opine/opine/src/types.ts:532

Check if the request is fresh, aka Last-Modified and/or the ETag still match.

### get

get: (name: string) => string | undefined

- Defined in home/runner/work/opine/opine/src/types.ts:408

Return request header.

The `Referrer` header field is special-cased, both `Referrer` and `Referer` are interchangeable.

Examples:

    req.get('Content-Type');
    // => "text/plain"

    req.get('content-type');
    // => "text/plain"

    req.get('Something');
    // => undefined

#### Type declaration

- - (name: string): string | undefined

  - #### Parameters

    - ##### name: string

    #### Returns string | undefined

### headers

headers: Headers

- Defined in home/runner/work/opine/opine/src/types.ts:578

### Optional hostname

hostname: string

- Defined in home/runner/work/opine/opine/src/types.ts:525

Parse the "Host" header field hostname.

### ip

ip: string

- Defined in home/runner/work/opine/opine/src/types.ts:492

Return the remote address, or when "trust proxy" is `true` return the upstream addr.

### ips

ips: string[]

- Defined in home/runner/work/opine/opine/src/types.ts:502

When "trust proxy" is `true`, parse the "X-Forwarded-For" ip address list.

For example if the value were "client, proxy1, proxy2" you would receive the array `["client", "proxy1", "proxy2"]` where "proxy2" is the furthest down-stream.

### method

method: string

- Defined in home/runner/work/opine/opine/src/types.ts:563

### Optional next

next: NextFunction

- Defined in home/runner/work/opine/opine/src/types.ts:589

### originalUrl

originalUrl: string

- Defined in home/runner/work/opine/opine/src/types.ts:571

### param

param: (name: string, defaultValue?: string) => string | undefined

- Defined in home/runner/work/opine/opine/src/types.ts:409

#### Type declaration

- - (name: string, defaultValue?: string): string | undefined

  - #### Parameters

    - ##### name: string

    - ##### Optional defaultValue: string

    #### Returns string | undefined

### params

params: P

- Defined in home/runner/work/opine/opine/src/types.ts:565

### Optional parsedBody

parsedBody: any

- Defined in home/runner/work/opine/opine/src/types.ts:603

After body parsers, OpineRequest will contain parsedBody property containing the parsed body. See: opine/src/middleware/bodyParser/

### path

path: string

- Defined in home/runner/work/opine/opine/src/types.ts:520

Returns the pathname of the URL.

### proto

proto: string

- Defined in home/runner/work/opine/opine/src/types.ts:577

### protocol

protocol: string

- Defined in home/runner/work/opine/opine/src/types.ts:478

Return the protocol string "http" or "https" when requested with TLS. When the "trust proxy" setting is enabled the "X-Forwarded-Proto" header field will be trusted. If you're running behind a reverse proxy that supplies https for you this may be enabled.

### query

query: ReqQuery

- Defined in home/runner/work/opine/opine/src/types.ts:567

### raw

raw: Deno.Reader

- Defined in home/runner/work/opine/opine/src/types.ts:561

Raw body of request.

### Optional res

res: OpineResponse<ResBody>

- Defined in home/runner/work/opine/opine/src/types.ts:588

After middleware.init executed, OpineRequest will contain res and next properties. See: opine/src/middleware/init.ts

### route

route: any

- Defined in home/runner/work/opine/opine/src/types.ts:569

### secure

secure: boolean

- Defined in home/runner/work/opine/opine/src/types.ts:485

Short-hand for:

req.protocol == 'https'

### stale

stale: boolean

- Defined in home/runner/work/opine/opine/src/types.ts:539

Check if the request is stale, aka "Last-Modified" and / or the "ETag" for the resource has changed.

### subdomains

subdomains: string[]

- Defined in home/runner/work/opine/opine/src/types.ts:515

Return subdomains as an array.

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 "subdomain offset".

For example, if the domain is "deno.dinosaurs.example.com": If "subdomain offset" is not set, req.subdomains is `["dinosaurs", "deno"]`. If "subdomain offset" is 3, req.subdomains is `["deno"]`.

### url

url: string

- Defined in home/runner/work/opine/opine/src/types.ts:573

### xhr

xhr: boolean

- Defined in home/runner/work/opine/opine/src/types.ts:544

Check if the request was an XMLHttpRequest.

## Methods

### accepts

- accepts(): string | string[] | false
- accepts(type: string): string | string[] | false
- accepts(type: string[]): string | string[] | false
- accepts(...type: string[]): string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:350

  Check if the given `type(s)` is acceptable, returning the best match when true, otherwise `undefined`, in which case you should respond with 406 "Not Acceptable".

  The `type` value may be a single mime type string such as "application/json", the extension name such as "json", a comma-delimited list such as "json, html, text/plain", or an array `["json", "html", "text/plain"]`. When a list or array is given the best match, if any is returned.

  Examples:

      // Accept: text/html
      req.accepts('html');
      // => "html"

      // Accept: text/*, application/json
      req.accepts('html');
      // => "html"
      req.accepts('text/html');
      // => "text/html"
      req.accepts('json, text');
      // => "json"
      req.accepts('application/json');
      // => "application/json"

      // Accept: text/*, application/json
      req.accepts('image/png');
      req.accepts('png');
      // => undefined

      // Accept: text/*;q=.5, application/json
      req.accepts(['html', 'json']);
      req.accepts('html, json');
      // => "json"

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:351

  #### Parameters

  - ##### type: string

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:352

  #### Parameters

  - ##### type: string[]

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:353

  #### Parameters

  - ##### Rest ...type: string[]

  #### Returns string | string[] | false

### acceptsCharsets

- acceptsCharsets(): string | string[] | false
- acceptsCharsets(charset: string): string | string[] | false
- acceptsCharsets(charset: string[]): string | string[] | false
- acceptsCharsets(...charset: string[]): string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:362

  Returns the first accepted charset of the specified character sets, based on the request's Accept-Charset HTTP header field. If none of the specified charsets is accepted, returns false.

  For more information, or if you have issues or concerns, see accepts.

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:363

  #### Parameters

  - ##### charset: string

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:364

  #### Parameters

  - ##### charset: string[]

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:365

  #### Parameters

  - ##### Rest ...charset: string[]

  #### Returns string | string[] | false

### acceptsEncodings

- acceptsEncodings(): string | string[] | false
- acceptsEncodings(encoding: string): string | string[] | false
- acceptsEncodings(encoding: string[]): string | string[] | false
- acceptsEncodings(...encoding: string[]): string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:374

  Returns the first accepted encoding of the specified encodings, based on the request's Accept-Encoding HTTP header field. If none of the specified encodings is accepted, returns false.

  For more information, or if you have issues or concerns, see accepts.

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:375

  #### Parameters

  - ##### encoding: string

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:376

  #### Parameters

  - ##### encoding: string[]

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:377

  #### Parameters

  - ##### Rest ...encoding: string[]

  #### Returns string | string[] | false

### acceptsLanguages

- acceptsLanguages(): string | string[] | false
- acceptsLanguages(lang: string): string | string[] | false
- acceptsLanguages(lang: string[]): string | string[] | false
- acceptsLanguages(...lang: string[]): string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:386

  Returns the first accepted language of the specified languages, based on the request's Accept-Language HTTP header field. If none of the specified languages is accepted, returns false.

  For more information, or if you have issues or concerns, see accepts.

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:387

  #### Parameters

  - ##### lang: string

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:388

  #### Parameters

  - ##### lang: string[]

  #### Returns string | string[] | false

- - Defined in home/runner/work/opine/opine/src/types.ts:389

  #### Parameters

  - ##### Rest ...lang: string[]

  #### Returns string | string[] | false

### is

- is(type: string | string[]): string | boolean | null

- - Defined in home/runner/work/opine/opine/src/types.ts:449

  Check if the incoming request contains the "Content-Type" header field, and it contains the give mime `type`.

  Examples:

       // With Content-Type: text/html; charset=utf-8
       req.is('html');
       req.is('text/html');
       req.is('text/*');
       // => true

       // When Content-Type is application/json
       req.is('json');
       req.is('application/json');
       req.is('application/*');
       // => true

       req.is('html');
       // => false

  #### Parameters

  - ##### type: string | string[]

  #### Returns string | boolean | null

### range

- range(size: number, options?: RangeParserOptions): RangeParserRanges | RangeParserResult | undefined

- - Defined in home/runner/work/opine/opine/src/types.ts:423

  Parse Range header field, capping to the given `size`.

  Unspecified ranges such as "0-" require knowledge of your resource length. In the case of a byte range this is of course the total number of bytes. If the Range header field is not given `undefined` is returned. If the Range header field is given, return value is a result of range-parser. See more ./types/range-parser/index.d.ts

  NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" should respond with 4 users when available, not 3.

  #### Parameters

  - ##### size: number

  - ##### Optional options: RangeParserOptions

  #### Returns RangeParserRanges | RangeParserResult | undefined

### respond

- respond(response: { body?: Uint8Array | Deno.Reader | string | ReadableStream; headers?: Headers; status?: number; statusText?: string; trailers?: () => Promise<Headers> | Headers }): void

- - Defined in home/runner/work/opine/opine/src/types.ts:617

  #### Parameters

  - ##### response: { body?: Uint8Array | Deno.Reader | string | ReadableStream; headers?: Headers; status?: number; statusText?: string; trailers?: () => Promise<Headers> | Headers }

    - ##### Optional body?: Uint8Array | Deno.Reader | string | ReadableStream

    - ##### Optional headers?: Headers

    - ##### Optional status?: number

    - ##### Optional statusText?: string

    - ##### Optional trailers?: () => Promise<Headers> | Headers

      - - (): Promise<Headers> | Headers

        - #### Returns Promise<Headers> | Headers

  #### Returns void

### upgrade

- upgrade(): WebSocket

- - Defined in home/runner/work/opine/opine/src/types.ts:468

  Upgrade an HTTP connection to a WebSocket connection by calling Deno.upgradeWebSocket.

  Example:

      app.get("/ws", async (req, _res, next) => {
        if (req.headers.get("upgrade") === "websocket") {
          const socket = req.upgrade();
          handleSocket(socket);
        } else {
          next();
        }
      });

  #### Returns WebSocket

  A socket object.

Generated using TypeDoc