Backend

Stauskoder & Error Handling


Dessa kan du returnera som svar i en Controller:
Ok() 200 OK; Sätt ditt returnerade objekt inom ( )
StatusCode(int statusCode, object value) Egen, custom status code.
BadRequest(object error) 400 Bad Request;
Forbid() 403 Forbidden;
Unauthorized() 401 Unauthorized;
NotFound(object value) 404 Not Found;

bild.png

Custom Errors:
bild.png
bild.png

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.