import { RequestContext } from "https://deno.land/x/windmill@v1.38.2/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
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
setBody(body: RequestBody)
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.