Learn with me Day 6:
In ASP,NET Web API 2, there are several types of action results that can be returned from a controller method. Here are some common ones:
HttpResponseMessage: Represents an HTTP response message, allowing you to customize the entire response, including headers and status code.
OkResult: Represents a 200 OK response with an empty body.
BadRequestResult: Represents a 400 Bad Request response.
NotFoundResult: Represents a 404 Not Found response.
InternalServerErrorResult: Represents a 500 Internal Server Error response.
UnauthorizedResult: Represents a 401 Unauthorized response.
ConflictResult: Represents a 409 Conflict response.
CreatedAtRouteResult: Represents a 201 Created response with a location header pointing to the newly created resource.
RedirectResult: Represents a 302 Found response, redirecting to a specified URL.
JsonResult: Represents a response formatted as JSON.
XmlResult: Represents a response formatted as XML.
ContentResult: Represents a response with a specific content type and content body.
These are just a few examples, and there are more specialized action results available in https://t.co/dw08ll6QOj Web API 2 based on the specific needs of your API.
CTGHUB x Seiyan by cult(Free Mint)
🎉 5x WL Spot for @SeiyanNFT
To enter:
1️⃣ Follow @SeiyanNFT & @ctghub
2️⃣ Like + RT + tag 3 friends
⏰ 48 Hours!
✨ Join in their Discord!
https://t.co/n3YjTjTddm