njs/response

Types

pub type Response
pub type ResponseOption(h) {
  ResponseOption(status: Int, headers: h, status_text: String)
}

Constructors

  • ResponseOption(status: Int, headers: h, status_text: String)

Functions

pub fn array_buffer(response r: Response) -> Promise(ArrayBuffer)
pub fn empty(option o: a) -> Response
pub fn from_buffer(body b: Buffer, option o: a) -> Response
pub fn from_string(body b: String, option o: a) -> Response
pub fn has_body(response r: Response) -> Bool
pub fn headers(response r: Response) -> Headers
pub fn is_ok(response r: Response) -> Bool
pub fn is_redirected(response r: Response) -> Bool
pub fn json(response r: Response) -> Promise(Json)
pub fn status(response r: Response) -> Int
pub fn status_text(response r: Response) -> String
pub fn text(response r: Response) -> Promise(String)
pub fn url(response r: Response) -> String
Search Document