Skip to main content
The Deno 2 Release Candidate is here
Learn more
class HttpResponseUtil
import { HttpResponseUtil } from "https://deno.land/x/sptaki@1.2.0/utils/HttpResponseUtil.d.ts";

Constructors

new
HttpResponseUtil(jsonUtil: JsonUtil, localisationService: LocalisationService)

Properties

protected
jsonUtil: JsonUtil
protected
localisationService: LocalisationService

Methods

protected
clearString(s: string): any

Add an error into the 'warnings' array of the client response message

getBody<T>(
data: T,
err?: number,
errmsg?: any,
sanitize?: boolean,
): IGetBodyResponseData<T>

Game client needs server responses in a particular format

getUnclearedBody(
data: any,
err?: number,
errmsg?: any,
): string
noBody(data: any): any

Return passed in data as JSON string