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
1
vote
1answer
81 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
0answers
28 views

node.js crud operations from a single view

maybe its a silly question but i've a fair amount of time looking trough google and i've reached and endpoint. i've got my node app working performing crud operations with 2 tables from a sqlite db, ...
1
vote
3answers
102 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
82 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 ...
-5
votes
0answers
83 views

How to call a list of REST APIs in huge volume to get optiomal performance? [closed]

I have written a Machine Learning based microservice in Python and using Flask for the REST endpoints. There is a need to pull data by calling around 4 REST APIs. But the call to the 2 APIs is going ...
38
votes
1answer
3k 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
54 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 ...
-2
votes
1answer
112 views

What is a good strategy to determine the maximum number or items an api endpoint should handle?

I am developing a REST api endpoint that accepts a list of item IDs and will return some details for each item. Let's make the following assumptions Performance wise in the DB there is no significant ...
1
vote
0answers
35 views

Best Way To Store Password & JWT on Mobile

I have a Flutter and Angular application that previously used Firebase, but for various reasons I'm working on switching it over to my own RESTful API with ExpressJS. One topic I'm a little confused ...
-5
votes
1answer
76 views

Giving a fixed project price when REST is involved

Whenever I am asked to give a quote for a project that involves a remote REST API, I become very cautious. Most of the REST API's I worked with had a documentation, but it usually turned out to be ...
0
votes
0answers
18 views

Using WebSockets for event notifications along side a REST API with scaleable architecture

I have a REST API which can be called with HTTP requests and is connected to a database to store resource state. There is a particular Parent resource that has a collection of Child resources and if a ...
-2
votes
1answer
22 views

RestAPI different json for list of items and item details

I have a RestAPI with two endpoints: /items - list of items /items/2 - selected by id, an item details returned json for list of items is { "id": "1", "name": "Max&...
-3
votes
1answer
43 views

REST API Testing best strategy

I'm currently developing a personal project using Django REST + React and as it grows more complex, I want to add unit testing to ensure that changes don't affect previous functionality. However, I'm ...
0
votes
0answers
31 views

REST API design: communicating order of inputs is important to the user (in POST request)

Let's say I have a REST endpoint where the order of inputs for a given field is important: POST Request: api.myrestendpoint.com/evolution-timeline/ inputs: {'this_list_should_be_ordered' : [ 'reptiles'...
-4
votes
1answer
61 views

Which API building practice is better?

Im working on a ERP product, In which backend logics are to be APIs. Right now I have around 80 Tables. Proposal 1: Creating CRUD APIs for all tables and manipulation of data to be handled in front ...
0
votes
0answers
30 views

Better understanding SRP: service for querying a REST api

I have a controller that receives some REQUEST parameters. These are forwarded to an importer service class. The importer then connects to a remote REST api which in turn will respond with a list of ...
0
votes
1answer
86 views

Is it a good practice to have an endpoint URL with path parameter accepting different type of values according to an indicator in the HTTP header?

Assume a resource URL in the context of REST API: /sites/<site id or site code>/buildings/<building id or building code> The value of the two path parameters, <site id or site code> ...
5
votes
4answers
435 views

Is it a good practice to have an endpoint URL with parameter accepting different type of values? [duplicate]

In my current maintenance project, there is REST API resource URL like this: /sites/<site id or site code>/buildings/<building id or building code> In this endpoint URL, there are two ...
2
votes
1answer
119 views

How to handle db password change in a live service

Suppose I have a REST application running on a remote server which connects to a mysql database. Now let's say the password of the db has to be changed. What are the right methods and practices that ...
0
votes
1answer
56 views

RESTful Response when the POST request results in the creation of different kind of resources?

I have been working on designing an API that lets client create a product (think of product as something like website domain, something that comes into existence when client makes order for it to the ...
0
votes
1answer
32 views

Photo Library Service: What should be right way of photo library using AWS S3 and Java

I want to make a service that is supposed to upload Photos in S3 and make them available using a link. I have few design plans for my service. PLAN 1: Upload photo to my REST API which will update ...
-1
votes
1answer
43 views

Android Chat Application Architecture with websocket

I'm trying to build chat application in Android (future maybe webapp also) using websockets. The purpose of this project is to familiar with websockets, get know websockets and real time applications. ...
0
votes
0answers
35 views

Using a message queue or pub / sub solution for connecting frontend to backend instead of REST APIs

I own a dell r620 server at home and want to make more use of it. Typically its my staging environment as my internet is currently ipv6 with dslite so I can’t port forward. But I can easily call and ...
0
votes
1answer
40 views

How to abstract the communication protocol used to communicate between different microservices?

I would like to implement a microservice which can support both REST and SOAP, and will use the protocol based on the client preference (or what the client is already using). I have been thinking of ...
0
votes
4answers
45 views

When to throw error in response vs save error in database for POST API

I am creating a API to create Personnels of X city. Assume that there is a generalised service for creating personnel of any city and I want to call this service for X city personnels from my API. ...
2
votes
1answer
152 views

Multiple HttpClients in .NET Core Console Application

I'm building a .NET Core class library wrapper for a REST API that, ideally, could be used in both console applications and ASP.NET Core web applications. So far, I've based development on supporting ...
1
vote
2answers
90 views

Best way for resource (entity) relations loading in a REST API

We have a problem of load time in our REST API, which is the result of having Fat DTO (nested DTO s) & the N+1 problem (which is off my question), means that we are loading too much data in one ...
0
votes
0answers
50 views

Creating a microservice REST api to offload CPU intensive tasks from node.js

I am building a game which has rooms with clients connected. Each room has it's own websocket. At the end of the game, some calculation needs to be made about who won and it's a complicated math CPU ...
0
votes
1answer
101 views

Is this an anti-pattern to have a service have both APIs and listening to events?

I am planning to make a service which will have simple REST APIs and will have a database in backend. I also wanted to add a logic to listen to notifications emitted by other service and there is some ...
-3
votes
2answers
60 views

How do I organize my REST API codes along with the codes for generating the website?

Using github as an example, www.github.com is the website people visit and api.github.com is the REST api server programs will visit. But they probably share some codebase and in my case they share a ...
0
votes
1answer
70 views

Different fields for GET and POST methods in REST

I have a collection /users/{userId}/tools and I want to GET and POST to that collection. Can I have different representation of that object based on the method? For example, for POST I want to send ...
-4
votes
1answer
93 views

Does it makes sense to implement a REST API for every app?

Is it mandatory to implement a REST API even if it doesn't make sense? I have created an app consuming REST services from other apps. Now that I have the final result, I wonder if it is needed to ...
0
votes
1answer
57 views

How do I stay RESTful when I have two child resources that need to change state independently of a parent?

I have three resource types - character, word, and write (these are three separate database tables, with word and write having a foreign key dependency on character). When character is created (upon ...
0
votes
1answer
73 views

SPA Routing with a RESTful API using HATEOAS

When using routing in a SPA web app (angular, react, etc), the user doesn't have to start at the entry point of the application. They can use a URL in the browser to drill down into any part of the ...
0
votes
1answer
40 views

REST action as part of request body - action not stored alongside entity

I am working on an API that allows a client document to updated under the endpoint of PUT /client/{documentId}. As part of this document, I need to include an extra field 'ReplicateInManager' that ...
1
vote
1answer
92 views

SDK design: Should I parse enum as string or as enum?

I am building a SDK that will simplify the use of my API. The problem is if when I have to return property of type enum. For example, I use strings instead of int for displaying enum such as { "...
1
vote
0answers
71 views

API Design (RPC - RESTful)

I'm new to API design. I've been reading numerous threads RESTful vs RPC patterns for API design, but I feel like none directly addressed my exact use case, so I just wanted to get a second opinion. ...
0
votes
0answers
23 views

Aggregate small spring-boot REST services into a big one as dependencies

I have build several small REST services based on spring-boot. Each of this REST service has an own database, own configuration and can run independently without the other services. Each service is ...
0
votes
2answers
113 views

Should we return a HTTP 404 or 400 for a customer record that doesn't exist? [duplicate]

I am creating a service to get the total yearly expenditure of a customer. The service input is the customer ID. If a customer that does not exist is received at the service, should a 404 (Not found) ...
0
votes
1answer
69 views

HATEOAS with Child Resources

Suppose Person has a Car. Car is a separate resource with its own URI. For the sake of this example, assume a person can only have one car. We want to include the Person's Car in the response when ...
0
votes
0answers
19 views

Can we create any number of model Objects in Spring web application?

In my methods of Service class, I need to do both Rest call and Database update, but the problem is, input of both these are different. Currently, I already have 2 model objects (say Employee for DB, ...
0
votes
0answers
16 views

Unity3d app as web client

Background Having the client web application and the server on the same network is safer, as one can expose the server ports only within the network, instead of making them publicly available. I ...
0
votes
0answers
53 views

RESTful query parameter at GET method

If I have a GET restful api use for query user info by user name. I don't want to return all column. My response column is decide to client. Example. My user have many column.(userName, sex, phone, ...
0
votes
2answers
112 views

Is it an anti-pattern for a REST-ful API object to contain different fields depending on context?

I'm working on an API that allows users to invite each other for events. When someone is searching for users to invite, I want to include in the response information about whether a user has already ...
-4
votes
1answer
31 views

How would I authenticating a Software Plugin with Username/Password using REST?

I'm developing my first Python plugin for a 3D application. What I'm looking to do I would like users who've purchased a subscription to the plugin from my Wordpress/WooCommerce web site to log in ...
-3
votes
2answers
64 views

Is a toggle side affect or propagation side affect, Restful?

We have a case where as it stands our API looks like api/workOptions/{workOptionsId}/items/{workOptionId} There exists business logic that only one workOptionId can have a status of "preferred." ...
0
votes
0answers
257 views

DRY(Don't repeat yourself) Principle and BFFs (Backend-for-Frontend)

We are about to plan our server architecture and we want to use the BFF strategy with node.js servers to serve multiple front-end apps. However we also want to be able to scale easily (e.g. a new ...
-1
votes
2answers
55 views

Is it bad practice to in a REST API to use Form Data in POST requests when all responses are in JSON?

When developing a REST API, is it ok to use Form-Data in POST requests or is that frowned upon? All my methods return a JSON body or only an HTTP code, should this be extended to my POST and PUT ...
1
vote
1answer
97 views

Long running REST API in PHP, async?

I have a RESTful API built with PHP. In POST request saving to DB is triggered. The problem is that now I have to support long running tasks. For example a user triggers POST request that is going to ...
0
votes
2answers
67 views

Rest API relationship design

I have a question in regards to designing relationships in REST API's. Imagine I have a relationship like in this diagram Now, should I show the relationship in the team endpoint like this? /v1/...

1
2 3 4 5
26