Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement http action results #39

Open
vunb opened this issue Oct 5, 2019 · 0 comments
Open

Implement http action results #39

vunb opened this issue Oct 5, 2019 · 0 comments
Labels
Rest Api Extension Label for extensions @kites/rest

Comments

@vunb
Copy link
Member

vunb commented Oct 5, 2019

List action results.

  • OkResult
  • OkNegotiatedContentResult
  • RedirectResult
  • ResponseMessageResult
  • StatusCodeResult
  • BadRequestErrorMessageResult
  • BadRequestResult
  • ConflictResult
  • CreatedNegotiatedContentResult
  • ExceptionResult
  • InternalServerError
  • NotFoundResult
  • JsonResult

Example:

@Controller("/todo")
class ToDoController extends BaseApiController {
    @Get("/:task")
    public async info() {
        return this.ok("foo");
    }

    @Get("/")
    public async list() {
        const content = { foo: "bar" };
        const statusCode = 403;

        return this.json(content, statusCode);
    }
@vunb vunb added the Rest Api Extension Label for extensions @kites/rest label Oct 5, 2019
@vunb vunb changed the title Implement OkResult Implement api returns OkResult Oct 5, 2019
@vunb vunb changed the title Implement api returns OkResult Implement http action results Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rest Api Extension Label for extensions @kites/rest
Projects
None yet
Development

No branches or pull requests

1 participant