radiant/response

Response builders for text, JSON, redirects, and status helpers.

Values

pub fn bad_request() -> response.Response(BitArray)
pub fn bad_request_with(
  body_text: String,
) -> response.Response(BitArray)
pub fn created(body_text: String) -> response.Response(BitArray)
pub fn forbidden() -> response.Response(BitArray)
pub fn forbidden_with(
  body_text: String,
) -> response.Response(BitArray)
pub fn html(body_text: String) -> response.Response(BitArray)
pub fn internal_server_error() -> response.Response(BitArray)
pub fn internal_server_error_with(
  body_text: String,
) -> response.Response(BitArray)
pub fn json(body_text: String) -> response.Response(BitArray)
pub fn json_error(
  status: Int,
  message: String,
) -> response.Response(BitArray)
pub fn method_not_allowed(
  allowed: String,
) -> response.Response(BitArray)
pub fn no_content() -> response.Response(BitArray)
pub fn not_found() -> response.Response(BitArray)
pub fn not_found_with(
  body_text: String,
) -> response.Response(BitArray)
pub fn ok(body_text: String) -> response.Response(BitArray)
pub fn redirect(uri: String) -> response.Response(BitArray)
pub fn response(
  status: Int,
  body_text: String,
) -> response.Response(BitArray)

Build a response with the given status and UTF-8 text body.

pub fn unauthorized() -> response.Response(BitArray)
pub fn unauthorized_with(
  body_text: String,
) -> response.Response(BitArray)
pub fn unprocessable_entity() -> response.Response(BitArray)
pub fn unprocessable_entity_with(
  body_text: String,
) -> response.Response(BitArray)
pub fn with_header(
  resp: response.Response(BitArray),
  key: String,
  value: String,
) -> response.Response(BitArray)
Search Document