Skip to main content
Module

x/windmill/windmill-api/http/http.ts>RequestContext

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
class RequestContext
import { RequestContext } from "https://deno.land/x/windmill@v1.28.1/windmill-api/http/http.ts";

Represents an HTTP request context

Constructors

new
RequestContext(url: string, httpMethod: HttpMethod)

Creates the request context using a http method and request resource url

Properties

private
body: RequestBody
private
headers: { [key: string]: string; }
private
url: URLParse

Methods

addCookie(name: string, value: string): void

Sets a cookie with the name and value. NO check for duplicate cookies is performed

getHeaders(): { [key: string]: string; }
getUrl(): string

Sets the body of the http request either as a string or FormData

Note that setting a body on a HTTP GET, HEAD, DELETE, CONNECT or TRACE request is discouraged. https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#rfc.section.7.3.1

setHeaderParam(key: string, value: string): void
setQueryParam(name: string, value: string)
setUrl(url: string)

Replaces the url set in the constructor with this url.