Avalonia Code OnlyItaliano

API › RAVAL

RResponse class

public sealed class RResponse

The response of a method with an HTTP status other than 200, or an error with its message.

Constructors

RResponse(int status, object body)

A status and an object to send as JSON.

Properties

int Status { get; }

The HTTP status (200, 201, 404...).

object Body { get; }

The object to send as JSON; null = response without a body.

Methods

static RResponse Created(object body)

201: created, with the new object.

static RResponse NotFound(string message)

404 with the message: { "error": "..." }.

static RResponse Error(int status, string message)

An error with its status and message: { "error": "..." }.