Questions tagged [rest]

Representational state transfer, or REST, is an architectural style for networking software to transfer information through the web.

Filter by
Sorted by
Tagged with
2
votes
3answers
81 views

Can REST resources represent behaviour?

In the red book by V. Vernon it says about REST: In RESTful HTTP, the methods are the HTTP verbs - most importantly, GET, PUT, POST, DELETE - that can be applied to resources. Even though it might ...
0
votes
3answers
84 views

How to design RESTful API for response object properties dependent on request parameter

I have a RESTful service where clients provide product codes, start date and end date. In response, the service returns a list of price metrics for the products over the date range. Start date is ...
0
votes
2answers
117 views

Does PUT need to be idempotent?

It has been said that "PUT is idempotent": The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side ...
-4
votes
0answers
45 views

Pros / cons of middlewares in restful apis? [closed]

At first, at my journey of learning full stack development in js, I read so many articles about nodejs, express and using middlewares functions. After learning about the benefits of typed languages, I ...
1
vote
2answers
231 views

Communication between two apps

I am thinking of creating two applications, one of which (App 1) will be in Django (DRF) and other (App 2)might be Django but might be another more lightweight framework (maybe Flask or plain Django ...
3
votes
2answers
242 views

Is rebooting a server idempotent or not?

In his article RESTful Casuistry, Tim Bray claims that rebooting a server is not idempotent: But I don’t buy it, and here’s why. If I want to update some fields in an existing resource, I’m inclined ...
0
votes
0answers
22 views

REST-API Frontend/Backend strategy/best practise for field-types and requests

I have simple single page application, using a rest-backend (Spring Boot) for CRUD-operations and an Angular 12 frontend. My requirements are not really advanced, yet I cannot find a tutorial which ...
0
votes
2answers
78 views

Best Practice: Should cascading updates be handled by the frontend or the REST API?

I am designing a timesheet app for logging user tasks using React for frontend and Django REST Framework for backend. The database is PostgreSQL and I have a table for recording the tasks with 4 ...
0
votes
2answers
43 views

Frontend/backend SPA communication: how to handle a list of string options

I have single page application with an Angular frontend and a Spring REST-backend. What is the proper way to handle a list of string-based options in the fronted the enduser can select from, which ...
0
votes
2answers
72 views

Move from mft to api REST style to get or post large data 200mb , is it best practice?

I am designing the API architecture for my client: My client actually exchange huge files (csv) with his Partner with MFT ( SFTP ) **Partner ==> MFT ==> Client ** The requirement is to move to ...
0
votes
1answer
43 views

DDD for middleware web application

I am developing a middleware application where the application workflow is: handles rest requests performs some business logic calls another rest service I would like to use DDD to model the ...
0
votes
2answers
49 views

Taking load off of Rest API with Cloudflare Cache?

I have a server running on AWS which serves data, that is not changing too often (think about a CMS system) to multiple clients. This service is critical for most of the client apps, thus I want to ...
1
vote
2answers
253 views

Roy Fielding’s REST alternative to HTTP cookies

I struggle to understand Roy Fielding’s REST alternative to HTTP cookies, § 6.3.4.2 ‘Cookies’ and § 6.5.4.1 ‘Application State in a Network-Based System’ of his doctoral dissertation Architectural ...
0
votes
1answer
36 views

Azure Event Grid API layer beneath a HTTP API layer

I am part of a project/team that is building a new web app in Azure for the first time, having previously built and developed a traditional three tier ASP.NET web app over a number of years. We have ...
2
votes
1answer
132 views

REST API noun vs verb and client vs server responsibility

I'm trying to delineate the responsibilities between client & server. I have the server parse a file, and then send back the uncategorized accounting transactions. The URL looks something like: ...
0
votes
0answers
46 views

Fetching data in separate servers

I have a monolithic REST API and a separate WebSocket server that’s used for real-time updates. They're both separate so that I can scale them independently. The API fetches data from the database and ...
2
votes
0answers
23 views

Populating form options in dynamic web form

I am looking for advice on database design for a web app I am building. In the web app (Angular, REST API, Oracle SQL database), I am constructing a web form dynamically. I chose dynamic form ...
0
votes
1answer
44 views

Displaying various subsets of content stored in a database

I am looking for advice on database design for a web app I am building. Part of the website needs to display content from a SQL database dynamically depending on the component's context. To be more ...
2
votes
2answers
156 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 ...
1
vote
1answer
59 views

Intuitive RESTful API design for logistics shipments availability, accept, allocation decision?

I am trying to model APIs for Create shipments Fetch Available shipments (based on region preferences) Accept shipments (allows logged in user to accept multiple shipments on first come first serve ...
0
votes
1answer
84 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 ...
0
votes
1answer
90 views

How To Use Semver In REST API Versioning

I am trying to understand one thing of using semver in rest apis. Semver says that Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the ...
0
votes
2answers
70 views

REST API Pattern for “pure functions”

What is the appropriate REST API pattern for a "pure function" that takes an input and returns an output, without side effects? A trivial case might be a REST API that returns the sum of a ...
4
votes
3answers
184 views

CQRS: getOrCreate - is this a command, query, or both?

Consider the following scenario: If the user isn't registered in the database, register them. Return their ID. If the user is in the database, return their ID. The API endpoint for this may look ...
1
vote
2answers
111 views

How to manage primary keys in CQRS

I'm building a backend following the CQRS pattern and I don't know how to manage properly the primary keys (surrogate keys) between the command and query databases. For example: I have a model with ...
0
votes
1answer
47 views

REST design for checking boolean property of a resource

My application provides the following resource: GET /user/:id/orders As commonly used, this returns a list of all the user's orders. Now, a client wants to check if a user has any orders at all ...
1
vote
1answer
95 views

Java REST services - What are best practices regarding DTOs?

I've been working on a project that communicates with a service which sends very complicated REST responses. Current "best practice" on this team is that we use POJO DTOs to handle all data ...
2
votes
3answers
121 views

Should our RESTful API be abstract or client-specific?

I work in the SAP industry where web-based UIs and RESTful APIs are a rather new thing, meaning some teams (like ours) don't have much experience in designing such systems. Recently there's been a ...
0
votes
0answers
46 views

Best way to share code of micro-services written in the server-less framework

The microservices are going to be owned by a specific team. These microservices each will have their own resources such as DB, API Gateway, queue e.t.c. Other teams will have their individual ...
0
votes
0answers
40 views

Which message pattern should I use for synchronous communincation in Nodejs Microservices?

My Nodejs microservices currently running on Kubernetes are communicating over REST. Does the request-reply model of NATS, which replier needs to return (large data ~ 500kb currently single endpoint ...
0
votes
1answer
43 views

Validating REST API requests against previous requests as part of a larger process

I am building a REST API for warehouse inventory picking. I have a very shallow understanding of REST, so to me that just == stateless and try to make your URL mappings nouns instead of verbs. The ...
1
vote
3answers
97 views

RESTful URLs for multiple resource in the same Microservice

We are developing a serverless application (AWS API Gateway, Lambda, and Dynamo) keeping users and groups in the same microservice as they are being stored in the same DynamoDB table. REST endpoints ...
0
votes
0answers
32 views

Using JWT token to create spring session

I have a web application like this: An angular frontend for client and a spring MVC backend for admin panel. A angular web application requests a JWT token from tomcat/spring MVC. The angular ...
0
votes
0answers
58 views

JSON Api Relationships and DDD Principles

In my current project we try to use DDD as development process and foundation of our architecture. For the REST-Interfaces it has been decided, that JSON:API is our way to go. Since DDD, REST and JSON:...
0
votes
2answers
80 views

best practice for PUT requests in REST API

What's the best practice around updating information received from the request? Update all the columns with the values received in the request object? What if there are columns that should be updated ...
3
votes
2answers
97 views

Checking the user in almost all use cases

I have a web application that has Users that belong to Companies. A User can only belong to 1 Company at a time and they can manage their own company information. I'm using java spring and I'm ...
0
votes
2answers
65 views

Rest API | Single Verb performs CRUD?

I have some logic that needs to be called by multiple applications ( mobile, web, ...). Instead of duplicating this logic, I thought of putting it in a Rest API so that I could call it from any of the ...
0
votes
1answer
46 views

POSTing a nested object - returning the created nested object inside the parent

Suppose that we have a Post resource (this is just a dummy example): GET /api/posts/1 { "id": 1, "header": null, "content": null } And now we'd like to create a ...
-1
votes
1answer
49 views

How to objectively monitor REST APIs perofrmance based on the request/response size

We recently integrated a monitoring solution (Data Dog) for our REST-APIs based microservices. The monitoring solution gives us many useful metrics. For example, we can see the average response time ...
-1
votes
1answer
83 views

Design Pattern for accessing data over RestAPI calls

I am looking out for a general design strategy or pattern designing various components in my client application. Here are high level details: The data is accessed my making a RestAPI call. The data ...
0
votes
0answers
14 views

Adding API wrapper to Vue project - any advices or recommendations?

I'm starting a new project that consists of backend (REST Framework - Django) and frontend (Vue app). First I'm trying to figure out the "best" way to handle API requests. For example - not ...
1
vote
2answers
118 views

How to design asynchronous endpoints in a REST API

Context Hi, in my job we are trying to modify an API endpoint (/resources) to make special queries to it. A resource has a location (long/lat) and we want to make queries based on that location. We ...
0
votes
1answer
77 views

Dependencies in microservices configuration

I'm dealing with a system where: A number of around 50 microservices are available Depending on their needs, clients design their deployment choosing which of those microservices they need Most of ...
2
votes
3answers
88 views

RESTful endpoints for returning same model based on different fields?

What is the recommended convention to be followed for identifying different GET endpoints that fetch the same model/entity using different fields/parameters? For example, there is a Student entity for ...
31
votes
6answers
11k views

Is exposing regex in error response to end user bad practice?

Say I have a have request payload PUT /user { email: "invalid" ... } In the backend there is a email regex, which I cannot modify. Currently the behavior is to output: { "error&...
1
vote
2answers
65 views

Where to store credentials for a tird-party API in my API?

So my current app process works like this: Client communicates with my API to get certain information My API needs information from a third-party API and uses these to create a response for the ...
2
votes
2answers
128 views

Should I create two synchronous or a single asynchronous rest APIs?

Here is the situation. System A sends the notification as it completes the work items to System B. System A does not know how many items the project consists of. It's just a pass-through system. ...
2
votes
2answers
76 views

How to use HATEAOS links to single entities in a frontend?

Context Let's say I have the API endpoints /api, /api/accounts and /api/accounts/{id}. As far as I understand, the idea is that a call to /api gives me a list of "base" API calls, among ...
3
votes
2answers
208 views

One API endpoint for each frontend “need”

Let's say our web application handles "orders". An order can be displayed in several different pages of our web app, on each one, in a very different way. For example: in page A, it shows ...
2
votes
2answers
237 views

REST API: POST and PUT for nested resources

I am wondering how to deal with nested resources in a REST API. I've seen other questions on the subject here, but I didn't find one that answered my question. More specifically, should POSTing/...

1
2 3 4 5
29