Kasky

Kasky

  • Documentation
  • GitHub

›References

Getting Started

  • Installation
  • Creating your First Project
  • Running your Project

Next Step

  • Controllers
  • Routing
  • Middlewares

References

  • Request
  • Response
  • @Controller()
  • @Route.<HTTP_METHOD>()

Response

The Response object contains methods for sending a HTTP response to the client.

Methods

header()

header(key: string, value: string): response

This method sets a response HTTP header.


send()

send(status: number, data?: any, contentType?: string): void

This method sends a response to the client.


success()

success(data?: any, contentType?: string)

Sends a response with status code 200.


created()

created(data?: any, contentType?: string)

Sends a response with status code 201.


notFound()

notFound(data?: any, contentType?: string)

Sends a response with status code 404.


badRequest()

badRequest(data?: any, contentType?: string)

Sends a response with status code 400.

unauthorized()

unauthorized(data?: any, contentType?: string)

Sends a response with status code 401.


forbidden()

forbidden(data?: any, contentType?: string)

Sends a response with status code 403.


internalServerError()

internalServerError(data?: any, contentType?: string)

Sends a response with status code 500.

← Request@Controller() →
  • Methods
    • header()
    • send()
    • success()
    • created()
    • notFound()
    • badRequest()
    • unauthorized()
    • forbidden()
    • internalServerError()
Kasky
Docs
Getting StartedGuidesAPI Reference
More
GitHubStar
Copyright © 2019 Kasky