server/request

Search:
Group by:

Types

BodyInit = object
  case
  of bitNull:
    nil
  of bitBlob:
  of bitFormData:
  of bitUrlSearchParams:
  of bitString:
CORSAttribute = enum
  caNoCors = "no-cors", caAnonymous = "anonymous",
  caUseCredentials = "use-credentials"
HttpMethod = enum
  hmGet = "GET", hmConnect = "CONNECT", hmDelete = "DELETE", hmHead = "HEAD",
  hmOptions = "OPTIONS", hmPatch = "PATCH", hmPost = "POST", hmPut = "PUT",
  hmTrace = "TRACE", hmTrack = "TRACK"
RawRequest = object
  url*: URL
  headers*: seq[HTTPHeader]
  body*: RequestBody
  httpMethod* {.jsget: "method".}: HttpMethod
  tocache*: bool
  urlCredentials*: bool
  credentials* {.jsget: "credentials".}: CredentialsMode
Request = ref object
  url*: URL
  headers* {.jsget.}: Headers
  body*: RequestBody
  httpMethod* {.jsget: "method".}: HttpMethod
  tocache*: bool
  urlCredentials*: bool
  credentials* {.jsget: "credentials".}: CredentialsMode
  mode* {.jsget.}: RequestMode
  destination* {.jsget.}: RequestDestination
  origin*: RequestOrigin
  window*: RequestWindow
  client*: EnvironmentSettings
RequestBody = object
  case t*: RequestBodyType
  of rbtNone:
    nil
  of rbtString:
    s*: string
  of rbtMultipart:
    multipart*: FormData
  of rbtOutput:
    outputId*: int
  of rbtCache:
    cacheId*: int
  of rbtBlob:
    blob*: Blob
RequestBodyType = enum
  rbtNone, rbtString, rbtBlob, rbtMultipart, rbtOutput, rbtCache
RequestMode = enum
  rmNoCors = "no-cors", rmSameOrigin = "same-origin", rmCors = "cors",
  rmNavigate = "navigate", rmWebsocket = "websocket"
RequestOrigin = object
  case t*: RequestOriginType
  of rotClient:
    nil
  of rotOrigin:
    origin*: Origin
RequestOriginType = enum
  rotClient, rotOrigin
RequestWindow = object
  case t*: RequestWindowType
  of rwtClient, rwtNoWindow:
    nil
  of rwtWindow:
    window*: EnvironmentSettings
RequestWindowType = enum
  rwtClient, rwtNoWindow, rwtWindow

Vars

getAPIBaseURLImpl: proc (ctx: JSContext): URL {.nimcall, ...raises: [].}

Procs

proc addRequestModule(ctx: JSContext): Opt[void] {....raises: [], tags: [],
    forbids: [].}
proc contentLength(body: RequestBody): int {....raises: [], tags: [], forbids: [].}
proc createPotentialCORSRequest(url: URL; destination: RequestDestination;
                                cors: CORSAttribute; fallbackFlag = false): Request {.
    ...raises: [], tags: [], forbids: [].}
proc credentials(attribute: CORSAttribute): CredentialsMode {....raises: [],
    tags: [], forbids: [].}
proc extract(init: BodyInit; body: var RequestBody): string {....raises: [],
    tags: [], forbids: [].}
proc fromJS(ctx: JSContext; val: JSValueConst; res: var BodyInit): FromJSResult {.
    ...raises: [], tags: [], forbids: [].}
proc getReferrer(this: Request): URL {....raises: [], tags: [RootEffect],
                                       forbids: [].}
proc newRequest(ctx: JSContext; resource: JSValueConst;
                jsInit: JSValueConst = JS_UNDEFINED): Opt[Request] {....raises: [],
    tags: [RootEffect], forbids: [].}
proc newRequest(raw: RawRequest): Request {....raises: [], tags: [], forbids: [].}
proc newRequest(s: string; httpMethod = hmGet; headers = newHeaders(hgRequest);
                body = RequestBody(); referrer: URL = nil; tocache = false;
                credentials = cmSameOrigin): Request {....raises: [],
    tags: [RootEffect], forbids: [].}
proc newRequest(url: URL; httpMethod = hmGet; headers = newHeaders(hgRequest);
                body = RequestBody(); referrer: URL = nil; tocache = false;
                credentials = cmSameOrigin; urlCredentials = false;
                destination = rdNone; mode = rmNoCors;
                window = RequestWindow(t: rwtNoWindow)): Request {....raises: [],
    tags: [], forbids: [].}
proc safeExtract(init: BodyInit; body: var RequestBody): string {....raises: [],
    tags: [], forbids: [].}
proc sread(r: var PacketReader; o: var RawRequest) {....raises: [],
    tags: [RootEffect], forbids: [].}
proc sread(r: var PacketReader; o: var RequestBody) {....raises: [], tags: [],
    forbids: [].}
proc sread(w: var PacketReader; o: var Request) {.
    error: "use RawRequest instead", ...raises: [].}
proc swrite(w: var PacketWriter; o: Request) {....raises: [], tags: [RootEffect],
    forbids: [].}
proc swrite(w: var PacketWriter; o: RequestBody) {....raises: [], tags: [],
    forbids: [].}