Skip to main content
Module

x/mith/request.ts>Request

A middleware framework for Deno's http/s server.
Latest
class Request
implements IRequest
import { Request } from "https://deno.land/x/mith@v0.9.6/request.ts";

This class represents the request object from Mith framework

Constructors

new
Request(req: ServerRequest)

Index Signatures

[key: string]: any

Properties

private
hasBody: boolean
private
hasQuery: boolean
private
parsedBody: Body | undefined
private
parsedQuery: URLSearchParams | undefined
serverRequest: ServerRequest

Methods

body(): Promise<Body | undefined>

Returns the body of a request in a JSON format If the body has not been parsed yet, it will run the body parser and then return the parsed body Performance Note: It only parses the body if the application requests it and only if there is a body to be parsed

query(): Promise<URLSearchParams | undefined>
setBody(body: Body | undefined)

response.body will always return the body parser with this method, thirdparty body parsers can be used by setting the parsedBody value mannualy