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
-5
votes
1answer
152 views

Is it a good practice to return a map or list as HTTP response

The result of processing an HTTP request consists of mappings. Each mapping is from an order number to an object. Is it a good practice to return this as an HTTP response whose body is a Map<String,...
0
votes
2answers
77 views

Check if can delete before save

I am designing an application that works with REST API requests for dealing with information stored in a database. The user will add, edit, delete information in this client and after SAVE the ...
0
votes
3answers
302 views

Is there a way to signal that an endpoint should be called before another in REST?

I have 2 endpoints: enpoint A can only be called if endpoint B has been called before at least once. After endpoint B has been called, endpoint A can be called multiple times. endpoint B can be ...
1
vote
3answers
80 views

API Versioning when changing a single HTTP Method of an entity

When making a decision to version an API. If you are making a change to an entity but are only making changes to the one of the HTTP Methods. For example POST /api/v1/customers accepts a list of ...
1
vote
1answer
49 views

Authentication-as-a-Service (Auth0) and retrieving user profiles for many different users

For my recent project I decided to leverage Authentication-as-a-Service, in particular I am using Auth0 but I do not think this particularly matters. I've got my React client set up correctly and I am ...
0
votes
2answers
89 views

Does presentation layer inlcude REST and SOAP services?

Please, consider three pictures, I found in internet: 1: 2: 3: I always thought, that REST and SOAP services are in service layer - see #1. However, if you look at #2, you'll see, that presentation ...
0
votes
2answers
117 views

Should I return user data in an authentication endpoint using JWT?

I implement an auth endpoint which takes an email and password and returns a JWT token. Inside the JWT there is a payload containing the user ID. Does it matter from a REST/JWT standards perspective ...
8
votes
5answers
373 views

How to map “mv” operation to HTTP verbs?

In designing a RESTful api the problem arises as to how best to allow resources to be moved between collections. Renaming a resource could be done by using PATCH but this is not the same thing as ...
3
votes
4answers
288 views

HTTP POST request status 200 vs 204 vs 404

Our POST API takes in an identifier (let's say deviceId) in order to compute the accuracy of the location we have stored for that device in a DB; the result of that compution is then saved in a ...
2
votes
3answers
135 views

Good ways to prevent client side logic duplication without HATEOAS?

I know HATEOAS can be a bit of a heated topic. Some people like it, some people don't. That is not what I want to discuss. What I want to discuss is what technology other than HATEOAS (or some form of ...
-1
votes
1answer
55 views

Angular: send form or object?

My question is about clean code or best practice. I have a big formGroup and in my opinion its more difficult to map the form to an object than to send the form to the backend. best regards
2
votes
1answer
158 views

Communication between services in a microservices architecture, is direct communication okay?

I've been reading a lot on why one should use messages (w/ event sourcing/CQRS) for microservices communication and I get it. But most of the stuff I read online state that the main reason for using ...
0
votes
1answer
61 views

Best technique for sending multiple files in a single JSON post with Vue/javascript?

Using Vue/Electron to post to rails/Postgres backend. Is there a common design pattern/approach to posting multiple audio file objects BUT in a single post request? My current process (which works, ...
1
vote
0answers
61 views

Rest API backend and React frontend is MVP?

I'm doing a website that has a React frontend that calls some RESTful API and I would like to know if this is an MVP pattern. I think that the React application implements the View and the Presenter, ...
1
vote
1answer
59 views

Handling multiple REST API versions in one codebase

I have a REST API (v1) which routes through to a Java springboot component for which I now need to introduce a number of breaking changes to add new and changed functionality (v2). I understand how I ...
0
votes
0answers
26 views

Correct architecture regarding web sockets in a chat app

I am developing a simple real time chat app using Flask and React with socketio on both sides. I have a sidebar on the left with all the chats/conversations/rooms. When the user clicks on a sidebar ...
2
votes
1answer
74 views

Parsing complex object-like parameters via CLI arguments

Say we have an API that accepts a list of objects. Something like: { "family": "Does", "contact_details": [ { "name": "John&...
1
vote
1answer
55 views

API pagination with external or centralised authorization

I am building a REST API which would power a front end as well as other 3rd party apps and hence I want it to be as "standard" as possible. Right now, I am trying to stick to HATEOAS. The ...
0
votes
2answers
157 views

How to design my REST API

As part of our project (web application), we have to design REST API to manage the users of our application. Our API will be based on a company user management product (I will call it: C.U.M.) that ...
1
vote
3answers
285 views

How to keep front-end models in sync with REST API/DB without any UI delay?

Here's my problem. I want to make fast, subsequent requests to a REST API endpoint (/todos/:id/position) that have side effects on other resources. As an example of 5 fast subsequent requests: PATCH /...
0
votes
1answer
71 views

Logging microservice - error level in URI or body?

For my use case I need to create a microservice that receives log messages through HTTP. I'm wondering about the reasons to pick either of these: Method: POST URI: /{logLevel}/ Body: { "message&...
-4
votes
1answer
83 views

API vs REST API

I recently posted this question: Rest API for multiple applications? After searching a bit more and reading this question https://stackoverflow.com/questions/41189842/what-is-difference-between-rest-...
0
votes
1answer
120 views

Rest API for multiple applications?

I recently started learning about REST APIs and I am trying to understand how they work and what they are used for. From what I have read so far and from what I understand, a REST API can be used as a ...
-1
votes
1answer
68 views

How to handle pagination in a stateless application having multiple components involved for the data?

This problem statement is around one UI component, 3 service components. The current design of the application is like: UI makes request to Service-A to get data Service-A first makes a call to ...
0
votes
1answer
88 views

RESTful API design when a “resource” is split between storage locations

Let's say you have a database-credential resource that stores a few things: whitelist of IPs that can connect connection password for the user When GETting / POSTing these, should they be under one ...
0
votes
3answers
169 views

How to write unit tests for REST API that are atomic?

I am writing a REST API for use by the front-end web and mobile frameworks. Naturally, I write unit tests for each endpoint, which makes developing, evolving, and maintaining the API easier. However, ...
-3
votes
3answers
111 views

Which approach is the most RESTful

As a team we are preparing a REST API for handling chargers' operations. Let's say we have a part of the code that is responsible for starting charging and for stopping charging. We want to provide ...
0
votes
2answers
281 views

A desktop app which incorporates a REST API?

I am planning to build an adapter between a PC and devices which have the same function but which have different interfaces. The adapter will probably be based on a Raspberry Pi and will have a touch ...
0
votes
1answer
51 views

HTTPSession for session state in web APIs?

We are building a set of web APIs. The web APIs are called by clients & can call each other. State is required by these APIs for the users session (e.g. shopping basket type stuff). The state ...
0
votes
3answers
106 views

REST API path parameter with multiple meanings

I have an API that manages projects. You can get a single project via this endpoint, where {id} is a numeric project ID: /projects/{id} Each project can have one or more tags. Now I want to add an ...
1
vote
5answers
298 views

What http codes should i return when user request file which doesn't meet his requirements

i have a case where user can filter and download multiple pdf documents merged into single file. The client should display an error message when no document's meets the filter, and ask for ...
0
votes
1answer
82 views

Correct Architecture for Monolith with Go

I'm designing a monolith RESTful API that potentially sometime in the future may turn into microservices. I'm also trying following Uncle Bob's clean code as well. My question lies in structuring the ...
-2
votes
3answers
352 views

RESTful API User Accounts

I'm trying to expose RESTful API endpoints for creating user accounts to access my API. So, this would be one of the first things my consumers would use. I'm trying to figure out if this is how I ...
-1
votes
3answers
83 views

best practice posting complex object to api

i am trying to figure out what is the best practice on doing POST calls when creating new complex objects. example assume this is the complex object i wish to send: { "firstname": "...
1
vote
2answers
574 views

Single item endpoint responses: List vs. object

So I'm currently working on building a restful API. Let's keep it simple and say I have two endpoints, both GET: /products /products/{productId} The first returns a list of all products, the second ...
2
votes
1answer
65 views

Distributed cart state in microservices

We have legacy app which keeps state of a cart in local storage on a Frontend (this decision was made long time ago by other devs). The cart is cleared from local storage after 2 hours if it is not ...
2
votes
3answers
109 views

When to derive user ID from authentication token vs. validate against?

I am using JSON web tokens, but this authentication token can be any token from which a unique user can be derived. I am designing a REST API that allows CRUD operations on resources owned by specific ...
1
vote
1answer
83 views

Consuming complex JSON service that does not have schema

Hi I have this weird situation where I have a JSON producing service that represents a very complex object graph and this bject graph does not have a JSON schema that it is based on. The reason for ...
2
votes
1answer
345 views

REST: upload binary data with PUT method

I have an restful app that uses PUT to replace existing data. For example, there's a user management url https://myserver/users, and to replace user data, for example, to change the name and the ...
1
vote
1answer
135 views

How to exchange rectangular arrays via HTTP efficiently and without tightly coupling requesters to responders?

Suppose a user defines input arrays on a JavaScript frontend. These are sent to a Python backend via the REST API. The backend computes a result for every combination of each array's elements. It ...
-1
votes
1answer
48 views

How to design API endpoints for resources that relate on eachother?

I am developing REST API using node.js and Express. I have Houses collection and Rooms collection. Every Room belongs to exactly one House for it's entire lifetime. I'm not sure how to design API ...
1
vote
4answers
99 views

Replace Rest verbs with custom object to drive resource operations

One of my clients has a Restful API on which I'm supposed to work on that only exposes two verbs: POST and GET. The POST endpoint is used in lieu of the standard Rest verbs: PUT, DELETE, PATCH. The ...
0
votes
1answer
109 views

Most approriate HTTP return code when record locked for update due to invalid data

Context Typical restful CRUD service, including PATCH method, whose API validates fields (eg the "name" field may not contain digits). However, data in the database (from backdoor ETL load) ...
0
votes
2answers
68 views

Structuring optional REST resource hierarchy

I am designing a REST service with multiple end points which will be servicing the following hierarchy: Department has many Category Groups Category Group has many Category(-ies) Category has many Sub-...
1
vote
1answer
85 views

REST : Static API design

Lets say, I have a scenario where I have to expose an api to fetch supported shirt sizes(small , medium and large) My initial thought was /v1/shirts/sizes - But this clashes with the existing fetch ...
2
votes
1answer
136 views

What do you call the combination of endpoint and HTTP method in a REST API?

Let's use the Twitter API as an example. My understanding is that we refer to /statuses/update as an endpoint and we refer to POST as a HTTP method. So what would term do you use to refer to the pair ...
2
votes
3answers
370 views

Back-end solution for pulling from CSV files

I'm building a data visualization that displays COVID information for the United States, at the city, state, and county level. The ultimate source of truth are three CSVs published by the New York ...
1
vote
1answer
90 views

What constitutes “identical” for the purposes of HTTP idempotence?

From RFC 7231 "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content" Section 4.2.2 "Idempotent Methods": A request method is considered "idempotent" if the ...
40
votes
1answer
4k views

How to design a REST API that can “prompt” the client about long-running operations?

Say you were to develop a REST API that provides access to a set of complex, long-running, operations. The typical paradigm for an API like this (as I understand it) usually involves (the client) ...
1
vote
0answers
61 views

Correct usage of ETags?

Currently my code makes a series of updates to some resource via a REST API but I also have some "rollback" logic that basically updates the resource to its original state before my updates ...

1
2
3 4 5
28