Questions tagged [web-api]
Specific APIs that communicate over web protocols, such as ASP.net Web API, as well as APIs that are exposed to web pages for network communication or apps for device communication
390 questions
1 vote
1 answer
335 views
Which approach to specifying a database connection in a web API, is preferred?
Where I work, they have never implemented web APIs. At my previous job, which I left 11 years ago, I would write several web APIs to be used for applications, reports, etc. So when I came to this job ...
1 vote
1 answer
169 views
ASP.NET MVC and Web API Together vs. ASP.NET MVC with JSON-Returning Action Methods
In an ASP.NET MVC application with views that make AJAX calls for widgets like dropdowns and data grids, is it better to use Web API controllers or regular MVC action methods that return JSON? The ...
4 votes
4 answers
848 views
Is it okay to deploy both front end and backend everytime if they are in a single repository
I have a project with .net core web api backend and angular as front end. I have single repository for both the projects with front end and backend in their own separate folders. I have written ...
0 votes
1 answer
524 views
Should you use nested routes within NestJS for a "RESTfull" API
Here is an Example API for managing companies, employees, and their children. My entity relationships are as follows: company -1:n-> employees -1:n-> children I’ve structured the API routes ...
1 vote
0 answers
112 views
How to model api error type with errorCode and parameters
I work on a spring kotlin backend which has an angular and a mobile frontend. We are currently working on error handling and we decided that the backend should return an error code, a general message (...
1 vote
5 answers
336 views
Purpose of async/await in web servers when stuck with legacy I/O
A couple days ago I asked about the Purpose of async/await in web servers, and got in-depth answers explaining how in fully asynchronous code, it frees up the CPU completely while also releasing the ...
0 votes
2 answers
176 views
Allow-Rendering-Prevent-Download Architecture
I am trying to devise a simple system that, with the use of tokens, allows a specific file to be rendered in the client's browser, yet prevents the user agent from being able to download the file. ...
0 votes
1 answer
140 views
Return response from controller or raise exception from service
I need some guidance on how to send error responses to client from WebAPI controller for an update operation. I need to check if data is changed and if it has duplicate data. I have service class that ...