If we develop either a Web App (Frontend) or an API (Backend).
We can use the MVC rachitecure for the both of them. But there is a small difference. In View part of the development the output for Web App is for example HTML but for API can be only JSON.
All the APIs have somethings in common:
- Stratus code
- Input and Output Content Formatter
|200 – Ok|
201 – Create
204 – No Content (for the requests which shouldn’t return anything like delete)
|– tell the search engine that a page has permanatly moved.|
– Most APIs don’t have need for this.
|400 – Bad Request|
401 – Unauthorized
403 – Forbidden
404 – Not found
409 – Conflict
|500 – Internal Server Error|
Input and Output Content Formatter
Media type is passed via the Accept header of the request. The media type can be the followings:
Attention: Using Azure App Service for deploying your code?
If an API will be deployed with .Net Core and via Azure App Service. We must pay attention to the version of the .Net Core in IDE and the supported versions of the Runtime Stack in Azure App Service. The following figure demonstrates the web app creation blade via Azure App Service.
The following image demonstrates the current supported runtime stacks.