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
8 votes
6 answers
739 views

How should an API handle unsupported fields?

Let's assume I have this API on /api/v2/persons that enables me to create new entries by POSTing this JSON: { "name": "me" } The API is implemented using Spring Boot and if ...
user avatar
  • 225
0 votes
3 answers
49 views

REST API: model file uploads as part of a resource or as subresources?

I am designing a REST API that has to deal with users and two video uploads associated to each user. So far, I've come up with two different approaches of modeling this: Video as part of a user ...
user avatar
  • 101
-4 votes
2 answers
268 views

One rest api endpoint for multiple resources [closed]

Hello im about to create dasbord for my website.. Dashboard will have multiple subpages like users, posts, roles etc.. I was thinking i would use only one rest api endpoint for those resources like /...
user avatar
  • 111
-2 votes
1 answer
97 views

rest api - can two endpoints return different models if both return order?

Is it under the rules of REST to return a different model of 'order' if someone call: /me/orders/222 Return values: - OrderId - Price or /customers/111/orders/222 Return values: - OrderId - Price - ...
user avatar
1 vote
2 answers
110 views

REST HTTP Response code for a resource that the user is not authorised to access

Suppose user A creates a private resource at, for example, /books/somebooktitle If user B attempts to access the resource at /books/somebooktitle what code should be returned? HTTP403: Permission ...
user avatar
  • 197
0 votes
1 answer
231 views

Best way to enable field removal through PATCH

I am developing a REST API and I would like to allow the users to remove a field of the object through PATCH. My idea was to use a null field on the PATCH body as a signal to remove this field of the ...
user avatar
  • 19
1 vote
1 answer
381 views

REST APIs vs Message brokers for Backend to Backend communication

We are a wholesale marketplace and we have three main products in our startup. The products are: 1- the marketplace app that allows customers to view products and purchase online. 2- the seller app ...
user avatar
1 vote
3 answers
148 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", ...
user avatar
0 votes
2 answers
476 views

Golang Design Pattern for Generating View Objects in a REST API?

I have moderate Golang experience and lots of experience in other programming languages such as Java, Python, Rust, Scala, and others. I'm comfortable with building REST services and most of the other ...
user avatar
  • 1,561
0 votes
2 answers
288 views

Is it possible to implement a RESTful API with a protocol other than HTTP(S)?

I was confused by the distinction between REST and HTTP, and I found this article that cleared things up for me. In summary, it explained that REST is a set of general principles for web communication,...
user avatar
  • 111
0 votes
2 answers
63 views

Eliminating duplication of validation metadata in client and server

I tried to find some insight in how to handle the duplication of client-side and server-side validation in my app. If, for example, I have an User Entity like this on my back end: type User struct { ...
user avatar
2 votes
4 answers
564 views

REST API endpoint returning detailed or summary data

I'm designing a REST API that returns a collection of elements that can contain some verbose metadata, similar to one that might return books from a library. Is there a REST API design pattern to ...
user avatar
  • 181
0 votes
1 answer
116 views

Using databases to store temporary results between the backend and frontend of a webservice

I have a multithreaded backend application. It is inputted x, and outputs y, and this makes up a "job". A job can take up to several seconds to complete. The application is fed input via ...
user avatar
  • 117
3 votes
2 answers
137 views

parameter longer than the length limit of GET into a RESTful interface

In a Restful API, it is better to use GET to list a collection. However, in our scenario, we allow people query with a list of parameters (say CodeList) and then return details. As we allow upto 500 ...
user avatar
  • 141
0 votes
0 answers
37 views

Logical grouping of properties vs class structure

The architecture i'm working with is that we have three services: Main service that takes care of the business logic. It exposes an internal API to proxy service in XML protocol. Proxy service that ...
user avatar
  • 101
1 vote
1 answer
74 views

What is the correct architecture for communication between an HTTP server and a WS server on the same machine running in separate processes?

I have a Node.js HTTP REST API server and a Node.js WS server. I separated them into 2 entrypoints so that they can be more easily debugged and run separated from each other, but now I need the REST ...
user avatar
1 vote
2 answers
60 views

How to properly implement Rest Controllers to handle overlapping entities?

I have: A User entity. A Poll entity. Relationship: User creates polls. Use-case: When an arbitrarily user is clicked his/her profile is loaded and shown. The profile includes a list of polls ...
user avatar
0 votes
1 answer
53 views

How to design a rest api for updating collection(ArrayList) of Resource in Spring boot?

I have a resource called Client and it has the following attributes id, name, redirect URLs(ArrayList). class Client{ int id; String name; List<String> redirectUrls; } I have all CRUD ...
user avatar
-1 votes
2 answers
135 views

Proper ways to manage evolving inter-communicated microservices APIs?

I'm working on a big C# application that is currently under development so we have some room for structural refactoring. The application is divided into 10 microservices, which some of them ...
user avatar
0 votes
1 answer
94 views

Does it make sense to spawn request driven jobs in a thread or process?

I've developed a large application that performs jobs, such that it receives input x and outputs y. For this application, speed is the top priority. The application is capable of running concurrently. ...
user avatar
  • 117
-4 votes
2 answers
120 views

Does the HTTP specification fully define the semantics of request methods?

I see two possible interpretations of the semantics of request methods defined in the HTTP specification RFC 7231: The intended effect of a request method is fully defined by the HTTP specification (...
user avatar
  • 570
0 votes
2 answers
176 views

How harm it can be to combine an update/create/delete REST request?

Currently I have being request do implement an endpoint that would be responsible to update/create/delete sub-items for a single entity. The entities in case are students in a given classroom and the ...
user avatar
  • 101
0 votes
1 answer
91 views

How to define API notations for multiple tables data in the response

The question is specific to the API notation shown in the screen under the heading Table Name with the comment Joins Multiple Tables. I am using Spring Boot with JPA (Database: RDBMS) I have defined ...
user avatar
  • 103
0 votes
1 answer
56 views

Use GET/POST to request a new URL to upload file

We have a REST API endpoint which creates a presigned url (/createPresignedUrl) to upload file. How that works is when API call is fired, server would create a presigned url and send that in response. ...
user avatar
  • 111
0 votes
0 answers
19 views

Web api talking to a separate process

I've been working on an application (let's called it AppX) that will be launched on RaspberryPi. It's being written in C++. As it will be a part of my smart home solution, I would like to add a ...
user avatar
  • 267
0 votes
2 answers
249 views

Multiple JSON REST Responses for the same API

I want to send two different json response for the same API based on a flag. I have a final response json as below for /api/v1/student/, which is created by fetching responses from few other REST apis....
user avatar
  • 3
0 votes
2 answers
145 views

A command as the intended effect of POST versus as the side effect of PUT

The intended effect (semantics) of the POST method is resource specific, e.g. executing a command with arguments: POST /command HTTP/1.1 {"parameter-1": "argument-1", "...
user avatar
  • 570
4 votes
3 answers
470 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 ...
user avatar
  • 247
1 vote
1 answer
130 views

Asynchronous HTTP request pattern

Here is the pattern that I thought about for a resource accepting a single asynchronous HTTP request at a time (i.e. a request which has not yet been fulfilled when the response is sent): Create a ...
user avatar
  • 570
-1 votes
1 answer
78 views

Question about calculating an SLA for a REST-API

I am somehow stuck with my thoughts about an SLA definition, which I plan to determine for a REST-API running on a public cloud. Imagine having a REST-API service running on Azure which has a database ...
user avatar
2 votes
3 answers
120 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 ...
user avatar
  • 396
0 votes
3 answers
531 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 ...
user avatar
  • 285
0 votes
2 answers
202 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 ...
user avatar
3 votes
2 answers
781 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 ...
user avatar
  • 151
3 votes
2 answers
382 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 ...
user avatar
  • 570
0 votes
0 answers
203 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 ...
user avatar
1 vote
2 answers
126 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 ...
user avatar
  • 19
0 votes
3 answers
382 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 ...
user avatar
0 votes
2 answers
496 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 ...
user avatar
0 votes
1 answer
202 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 ...
user avatar
  • 3
0 votes
2 answers
182 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 ...
user avatar
  • 109
1 vote
2 answers
343 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 ...
user avatar
  • 570
0 votes
1 answer
81 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 ...
user avatar
  • 325
2 votes
1 answer
141 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: ...
user avatar
  • 1,149
0 votes
0 answers
55 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 ...
user avatar
  • 1
2 votes
0 answers
31 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 ...
user avatar
0 votes
1 answer
74 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 ...
user avatar
3 votes
2 answers
623 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 ...
user avatar
  • 139
1 vote
1 answer
71 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 ...
user avatar
0 votes
1 answer
204 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 ...
user avatar

1
2
3 4 5
30