Types
NativeRequest = asyncHttpServer.Request
- Source Edit
Request = object nativeRequest*: NativeRequest cookies*: CookieJar postParams*: StringTableRef queryParams*: StringTableRef formParams*: FormPart pathParams*: StringTableRef
- Source Edit
Procs
func contentType(request: Request): string {.inline, ...raises: [KeyError], tags: [], forbids: [].}
- Gets the contentType of the request. Source Edit
func initMockingRequest(httpMethod: HttpMethod; headers: HttpHeaders; url: Uri; cookies = initCookieJar(); postParams = newStringTable(); queryParams = newStringTable(); formParams = initFormPart(); pathParams = newStringTable()): Request {....raises: [], tags: [], forbids: [].}
- Initializes a new Request. Source Edit
func initRequest(nativeRequest: NativeRequest; cookies = initCookieJar(); pathParams = newStringTable(modeCaseSensitive); queryParams = newStringTable(modeCaseSensitive); postParams = newStringTable(modeCaseSensitive)): Request {. inline, ...raises: [], tags: [], forbids: [].}
- Initializes a new Request. Source Edit
proc respond(request: Request; code: HttpCode; body: string): Future[void] {. inline, ...raises: [Exception], tags: [RootEffect], forbids: [].}
- Responds code, body to the client, the framework will generate response contents automatically. Source Edit
proc respond(request: Request; code: HttpCode; body: string; headers: ResponseHeaders): Future[void] {.inline, ...raises: [Exception], tags: [RootEffect], forbids: [].}
- Responds code, body and headers to the client, the framework will generate response contents automatically. Source Edit