Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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

Filter by
Sorted by
Tagged with
0 votes
4 answers
82 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 ...
Medinoc's user avatar
  • 267
14 votes
3 answers
5k views

Purpose of async/await in web servers

I don't understand why I keep seeing async/await recommended (or sometimes, even enforced) for ASP.NET Core web applications and APIs. As far as I can tell, every request is already being run on a ...
Medinoc's user avatar
  • 267
0 votes
2 answers
147 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. ...
oldboy's user avatar
  • 103
0 votes
1 answer
77 views

How to create QueryBuilder to work with concurrent requests

I need assistance with the QueryBuilder that generates OData query. Following is my implementation and it approach has couple of issues If user forgets to SetRootTable then it will cause serious ...
Sunny's user avatar
  • 937
0 votes
1 answer
101 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 ...
Sunny's user avatar
  • 937
2 votes
3 answers
342 views

Does it make sense for an API with 1 daily job to do to be asynchronous?

This is a conceptual question about whether my specific use-case warrants the use of an asynchronous API. Language: Python 3.11 Framework: FastAPI (ASGI) I believe I am confused about what an ...
nonohat's user avatar
  • 53
1 vote
2 answers
93 views

Request validation on API proxy

I am creating an API proxy that acts as a bridge between our frontend application and an AWS opensearch server. This proxy has additional features such as retries and timeouts. One of the features I'm ...
lightning_missile's user avatar
0 votes
4 answers
312 views

How exactly is the cancellation token mechanism implemented over HTTP?

In a web application with a frontend and a backend part, how exactly is the cancellation token mechanism implemented over HTTP? HTTP is a stateless protocol and it does not allow "sharing" ...
Val's user avatar
  • 167
0 votes
1 answer
305 views

Is 10 KB a large amount of data to pass around each time a user makes an API call?

Each time a user of my APP / website interacts with the APP such that it makes an API call to the backend, the backend will make an API call to the mongoDB database to retrieve the document that holds ...
Bear Bile Farming is Torture's user avatar
0 votes
2 answers
831 views

Do we need APIs to just access databases?

At work, we have a Web application, which makes queries to databases, and I’m asked to determine if using Web APIs could be an added value. Personally, I’m not convinced it is. I know Web APIs are ...
Pine Code's user avatar
  • 109
0 votes
0 answers
167 views

REST Api filtering, sorting and order

I've seen in several REST API guidelines recommendations to use filtering in form of, e.g.: /products?filter=name eq 'Milk' or price lt 2.55 (example from: https://github.com/microsoft/api-guidelines/...
andrew.fox's user avatar
1 vote
2 answers
1k views

Why do Streamlit applications often consume a FastAPI backend?

I am fond of writing Streamlit applications (when a front-end is needed) and fastAPI backends when I just need a REST API. I've seen many blog posts where these two are combined - with the Streamlit ...
MYK's user avatar
  • 343
0 votes
2 answers
304 views

Is this service considered "an API"? Could it benefit from being Restful?

I'm confused about the meaning of API, specially in the context of REST. I'm thinking of one example. My company creates an application that runs on a server (the "backend"). (JavaScript in ...
Juan Perez's user avatar
0 votes
1 answer
98 views

Should I create access control as a microservice or keep the access control logic as part of the specific microservice?

I was wondering if I have a microservice called, for example, Weather, and only certain people can update certain properties around the weather such as Temperature, Precipitation, and Wind. These ...
David King's user avatar
2 votes
1 answer
782 views

Aggregating responses from several services with reversed proxy (API gateway): where to place code?

We have a system with a few microservices and multiple clients (Web, mobile). Currently, only one microservice (let's call it "Master MS") exposes a public API, which is used by all clients. ...
Maxim Zabolotskikh's user avatar
0 votes
3 answers
139 views

Is it a bad practice to include fields on DELETE requests that will enforce them, but only in on certain environments? [closed]

I've seen similar questions but in this case the code deployed to all stages (local, dev, staging, prod) will be the same. The idea is to have a special field on one particular request, something like ...
fedest's user avatar
  • 119
2 votes
2 answers
1k views

Improve performance for HTTP Request with huge body

I'm struggling to understand how to improve the performance for an HTTP Request that comes with a huge body. Now, let me explain better what I mean with performance! Imagine I have a DB with the table ...
Jolly's user avatar
  • 123
5 votes
1 answer
3k views

Should web API controller actions that perform no async work always be declared as async?

I have been going over our app web api and making sure all async work is async all the way - and no artificial asynchronicity is enforced. Say I have the following web api controller: [HttpGet] ...
Veverke's user avatar
  • 451
0 votes
2 answers
50 views

Specifications to build a API context data

I was developing a new API, and some doubts appears about context of payload data. Example: { "transaction_id": 123, "transaction_date": "2022-12-25", "user_id&...
Marcelo de Andrade's user avatar
2 votes
1 answer
2k views

onion architecture - calling external APIs

Umbrella Question In an onion architecture, where do all the components needed to consume an external API fit in? The following is the architecture I have so far, based off an example found here: ...
dot's user avatar
  • 571
6 votes
3 answers
2k views

Difference between API and protocol?

What's the difference between an API and a protocol? To use a specific example: Is Coinbase's choice to refer to its WebSocket client specification as an "API" appropriate? It seems that ...
Katie's user avatar
  • 239
4 votes
3 answers
242 views

Designing an API for international markets

I am working on a REST API for a company that, until recently, has been focused on the Australian market. The result of this is that the API has resources and fields which model the Australian market, ...
David Keaveny's user avatar
0 votes
1 answer
160 views

Is there a best practice for storing multiple pages of JSON responses from an API?

Scenario: An API that responds to a request with multiple JSON objects contained in an array. The responses are paginated such that each page returns an array of JSON objects. I deserialize the JSON ...
chrisxfire's user avatar
1 vote
0 answers
631 views

How to handle relationships between resources in Restful API

Problem Hi, we have an API that it's pretty similar to a standard CRM. That is, we have a really big amount of resources (even our own customers can define new resources). All of these resources share ...
Antonio Gamiz Delgado's user avatar
-1 votes
1 answer
53 views

Dashboard based on 3rd party application - duplicate data to local db or should I view the third party as my database?

I am currently building a web based solution based on an application used in my organization. The application have an integration (SOAP-based API). To keep things simple, I want to build a analytics ...
oliverbj's user avatar
0 votes
2 answers
942 views

REST Api - deleting a resource based on either ID, or its OwnerID

I have this list of Notes: public static List<Note> _notes = new List<Note> { new Note { Id = new Guid("00000000-0000-0000-0000-000000000001"), CategoryId = "1", ...
Octavian Niculescu's user avatar
1 vote
1 answer
477 views

Testing API with Auth0-enabled user authentication and authorization

I have a REST API and a SPA application, with Auth0 server issuing access tokens and enabling end users to login with their social identity provider. The API expects to receive a JWT access token with ...
0lt's user avatar
  • 113
0 votes
0 answers
340 views

.Net Core Api - multiple Dto’s for single entity

I want to know the best Practice is about having multiple dto’s for different use cases. Let’s say we have an api with a set of controllers to handle requests coming from a administration backend and ...
Martin C's user avatar
-2 votes
1 answer
282 views

How often should I request a token when communicating with a third-party API?

I have an ASP.net web API. I would like to call another API that has an authentication token inside my API. The code flow is as follows: My API is called → Get authentication token from 3rd party API →...
raysefo's user avatar
0 votes
1 answer
456 views

How to Properly Design an API Prefetch System

I'm creating an API for a web service. There are a couple of endpoints in this API that require some time (lets say +5min) to compute, so I'm creating a prefetch system that will call in the ...
Stack's user avatar
  • 151
1 vote
3 answers
862 views

Should I unit test functions internally used by API I expose?

I'm writing a CRUD app in Python that exposes web API. At first I wrote functions for communicating with DB and wrote tests for these functions. def crud(): # do something with db def test_crud(): ...
CommanderPrice's user avatar
1 vote
2 answers
500 views

What Is the Industry Standard of Specifying APIs for Frontend-Backend Handshake?

I am somewhat new to web development and maybe this question belongs to stackoverflow, but there is a human-interaction component here. Here is the scenario. I am serving some neural network models ...
Della's user avatar
  • 121
0 votes
1 answer
154 views

Best mapping practices in an enterprise application

This question might seem like a trivial question. But here it goes. Currently, I'm working with this .NET Core application, an N-tier application consisting of a Vue frontend, business logic layer, ...
XRaycat's user avatar
  • 131
1 vote
1 answer
2k views

RESTful web APIs using MVVM architecture

As the title implies, I would like to know if it is possible to create RESTful web APIs using MVVM architecture? Or we can use just MVC pattern to create web APIs?
Commander's user avatar
  • 113
0 votes
0 answers
123 views

What would be the best way to queue asynchronous calls received simultaneously by a web service cluster?

I have an API where every time is called there are multiple calls to multiple webservices in the background, sometimes it takes up to 20 seconds to process the request calling up to 10 different web ...
Mario Arturo's user avatar
1 vote
0 answers
173 views

What is the benefit of performing authn/authz at the API gateway instead of at the service?

I want to know is if we should perform authentication at the API gateway, at the individual service, or both. Let's frame this question and descussion in the context of new development. Specifically, ...
Mike G's user avatar
  • 239
1 vote
3 answers
559 views

Is the "archetype controller" really complies with REST architectural style

I've read the Fielding's thesis that defines the REST architectural style and noticed that the defined style appears to significantly conflicts with the so called "archetype controller", ...
Danilo Mendes's user avatar
2 votes
1 answer
301 views

Best practice for designing a WebAPI for exposing data in a SQL database interacting with C++ and C# applications

I am looking for general guidance or any relevant links for a complex project. We are a small business that sells a construction materials testing software. The client is a Windows application with ...
Hottemax's user avatar
  • 129
0 votes
0 answers
883 views

add web api endpoint, which return html from view

I have ASP.NET 5 Web Api and need to do the following task: Add endpoint, which get cshtml page and return generated html, so it should do the same what is does razor view engine. What is better way ...
Alexan's user avatar
  • 249
1 vote
1 answer
1k views

Should integration tests cover calls from web app to API?

My solution consists of an API for data access and a web application that calls it. I have integration tests set up for the API. However, the actual Web application that calls the API is not a part of ...
Peter Dongan's user avatar
1 vote
2 answers
1k views

JWT logout: Sharing blacklisted invalid token among services

I am working on a microservices project involving 4 services - Auth Service, Service-A, Service-B and Service-C. All the services are implemented using Spring Boot. The Auth Service is responsible for ...
user14132461's user avatar
0 votes
1 answer
3k views

Blacklist JWT tokens or whitelist JWT tokens

I am working on a Spring Boot web application. The REST APIs are secured by JWT tokens. Currently I have only access token generated (not implemented refresh token concept). My question is related to ...
user14132461's user avatar
6 votes
3 answers
2k views

GET vs POST when exposing machine learning model predictions using a REST API

So the recommendations for using GET vs POST in a REST API that I've read on stack overflow are geared almost exclusively toward CRUD operations involving a database. However if you are simply writing ...
erotavlas's user avatar
  • 267
3 votes
7 answers
3k views

Representing a large list of complex objects in JSON

I am currently developing an API that returns JSON structures. One of the domain objects returned is a time series, which is a potentially large list (many thousands of elements) of complex objects. ...
Felk's user avatar
  • 194
1 vote
0 answers
36 views

Two step provisioning using OIDC and AD?

A client requested that we implement the following authentication/authorisation flow: User authenticates using OIDC via a IAM (Salesforce in this case). If user is an external user, then a flag is ...
dd_dent's user avatar
  • 33
7 votes
2 answers
7k views

What layer do third party API request/response models go in and what do you call them?

I have a RESTful API service that has three layers: Application/Domain, Infrastructure, and Presentation. Application/Domain contain my interfaces and models. I currently have three different types of ...
brandon d tran's user avatar
0 votes
0 answers
81 views

Repository Pattern to support Bounded Context

I am building a REST Api from scratch so i am overthinking and revisiting various approaches and best practices. I have a Materials repository that serve all the sub-domains of our logic. Also i have ...
e4rthdog's user avatar
  • 267
5 votes
2 answers
5k views

Should I return always a JSON for only one value in a REST API or is it ok to return just the value?

For example, I create an API endpoint that provides the next available label for creating some items, so I call it like this: GET /api/v1/get-next-label/ Is it ok to return just: LBL-000001 Or is it ...
nck's user avatar
  • 159
0 votes
1 answer
269 views

How to architect a collaborative web application for live updates?

When using collaborative applications like issue trackers, planning tools, etc. it can be very frustrating to have to keep hitting refresh to make sure you're viewing the same state as your colleagues....
Salvatore Shiggerino's user avatar
3 votes
1 answer
3k views

REST: How to "upsert" a resource without an specific resource URL

I'm trying to create a REST API that allows the user to: create a resource if it doesn't exist. update a resource if it exists. with the same request. Given an example: I have a company that has ...
Danilo Mendes's user avatar

1
2 3 4 5
8