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
2answers
65 views

Combining PUT and POST on the same resource

I have the resource OrderRequest which I guess can be qualified as process. The OrderRequest can be create of update. The create should be idempotent, because creating the same order request 2 times ...
8
votes
2answers
206 views

API endpoint POST vs GET

Help me settle an internal question. We have an endpoint which we all agree should be a GET, because all it's doing is calling a stored proc and returning a set of data. However, there is a set of ...
-1
votes
0answers
36 views

Which of these is a better practice to write Python unittest for CRUD operations of REST api?

I have a python class that has methods to perform the CRUD operations via REST api: class my_class(): def get_obj(self,...) -> requests.Response: res = requests.get(...); ...
1
vote
1answer
30 views

Determining the service calls within the API based on the each consumer request

Currently, I have a rest API service which serves to many different consumers. One of the endpoints of API is for retrieving an order. Inside a single application, I am making 5 different service ...
4
votes
5answers
112 views

How to designing API JSON Response with nullable fields

We were discussing how to design a API response, for simplicity, think of having to give information of all the different types of facilities available in a city: { "city": { "cityName": "...
1
vote
1answer
32 views

RESTful API design using HATEOAS - Decision on Structure

We're designing and developing an enterprise application using Spring Boot for REST APIs and Angular 8 as the web client. It's been an year since we started. When I started, I read multiple articles ...
0
votes
1answer
78 views

REST - PUT or PATCH when updating all properties of an entity

In a REST API, when I want to update all the properties of an entity, what is better to use in terms of good practices? PUT or PATCH? If it is better to use PATCH, why is PUT necessary? What would be ...
1
vote
4answers
86 views

Performance issues in an pseudo microservice environment

I'm currently working on a project which is build as a microservice architecture. We have one "Gateway" which aggregates the data coming from the different microservices to return one aggregated ...
0
votes
1answer
47 views

REST: Seperate API endpoints for user images and all images?

I'm designing an API for a website where users can share images and all other users can see these images. The current idea is to have a path /user/name/images/xyz to GET a user's image and then a ...
2
votes
2answers
186 views

Should POST and PUT handlers do pre flight check for 404?

When implementing GET on a resource is makes sense to respond with 404 if the resource cannot be found. For POST and PUT verbs it is a little more complicated. To respond with 404 in that case I ...
6
votes
3answers
337 views

Which of these microservice designs is correct?

I have done quite a bit of reading about microservices but I have so far never designed any. I am working on doing that now and I am wondering which approach is correct (see the image below). ...
0
votes
1answer
57 views

GET Parameters in Restful API

I'm in the starting phases of designing an API. I'd like it to be Restful and comply with what's commonly considered best practices. One of my resources need to accept several query string parameters....
1
vote
1answer
49 views

Should a REST API be used when a websocket is already open?

Background: I was working on a web-socket application integrated into a more conventional http request based website that uses REST APIs. Task: I need to retrieve user history from the database for ...
2
votes
2answers
126 views

Can nonce be used to achieve Idempotency in REST API?

Stripe API uses a key called Idempotency-Key for achieving idempotency: https://stripe.com/docs/api/idempotent_requests. Is this similar to a nonce?
3
votes
1answer
83 views

Is this a good design for wrapping asynchronous API calls into a RESTful interface?

I'm working with an API that has many asynchronous calls and handlers. I'd like to extend these with a RESTful interface and endpoints in spring. I'm imagining the usual Controller and Service layers, ...
1
vote
5answers
178 views

REST API Design - Reordering Collections

Imagine that I have a system to manage sports teams. Let's not make it specific to a particular sport, but consider that each team consists of a number of players. Therefore, I might have an ...
-2
votes
1answer
69 views

Centralized REST API call management?

I was given a solution with many projects. Multiple projects call multiple REST APIs. These calls are scattered around the spaghetti code. Trying to figure out what calls are done in what sequence ...
0
votes
1answer
74 views

Implementing RESTful API in front of Event based microservices

I'm working on a system that implements multiple microservices which communicate via a RabbitMQ messaging bus. These microservices are created using python with the pika library (to publish messages ...
2
votes
1answer
112 views

How to parse a dynamically changing Json file? (c#)

So I know a little bit about parsing Json data but not too much so pardon if I am not describing everything as I should. Lets use this Json file as an example: { "firstname": "John", "...
-2
votes
0answers
58 views

Rest API better alternative to polling for asynchronous long running task

I have created a flask restplus API that accepts xlsx file as input and returns an XML. This would be consumed internally by our different APIs The current flow: other API POST an xlsx file by ...
1
vote
1answer
78 views

How to keep user inputs consistent with assumed inputs to slow computations at the backend?

Background: I'm writing a clinical trials simulator. The user defines future trial options, eg a trial with 100 placebo patients, 200 treatment patients, "optimistic" outcome scenario, etc. There can ...
0
votes
0answers
35 views

REST api - search url

I'm building a REST api and want to make sure to follow the best practices. I need to expose a method which will return a 'Document' entity by its 'Lot' number. It is possible that for a specific '...
1
vote
2answers
128 views

how to build microservices that also have GUIs

In a microservices architecture where each component does one thing, how do you handle GUI logic? How do you avoid building a front end web application that has a lot of smarts built into it where it ...
0
votes
2answers
90 views

How to increase difficulty of intercepting resources downloaded from developer console

I have a web application that allows user view our data that front-end in JavaScript fetches the data via a Restful request to back-end, then render it in the application. The size of each data can ...
0
votes
1answer
86 views

Should a GET endpoint in API server A make a POST request to a separate API server B?

I'm having trouble finding an answer for this when I search variants of my question. A use case I'm thinking of is a client makes a GET request to API server A for some data, but in order to provide ...
2
votes
3answers
149 views

Rest API design - ids as string

I started creating an application which uses strings as key, in order to have readably, non-guessable API values: GET https://myApi.com/docs/obuxn6xhzg GET https://myApi.com/docs/qxfj1g40xf PUT https:...
-3
votes
1answer
149 views

A True RESTful API | Help needed

I know that a RESTful would have unified API and it treats everything as a resource (a noun, example a book, a product,...) and it can be applied with CRUD operations using HTTP Verbs (GET, PUT, POST, ...
2
votes
4answers
197 views

Is it better for a microservice to access database tables individually or to work with joined data?

In my limited understanding of microservices they seem to focus on quite limited pools of information, leaving it up to the application to bring all the data together in ways which were perhaps not ...
6
votes
4answers
878 views

Is it a bad idea to pass JSON objects on the query string for an API “search” operation?

I'm building an API endpoint for a UI grid to search, filter, and display a list of domain objects, let's call them "widgets." In the past, I would have built this with a list of named query string ...
1
vote
3answers
317 views

Should 404 response include body

I wanted to know what fellow developers follow while designing rest API error responses. For all the not-found get resources, do you also send the some sort of body indicating that resource was not ...
0
votes
1answer
98 views

What is the best practice to insert two similar records in sql server db table which will be sent to two different destinations?

I am working on parsing a file and inserting records into SQL Server DB.The database table structure will be something like this: A Users table which contains (id, name, address, destinationName,...
-1
votes
1answer
46 views

Would it work to use http patch more general and even “unpatch”?

Is it a good idea to make http patch more general and also create a new property or even a new persistent entity if it does not exist. The patch could be general and send http body for different ...
1
vote
1answer
76 views

Design of a Router/UrlMatcher

Note: I am not sure if the question belongs to this particular stackexchange . If it does not, please let me know and I will delete it here and post it on the relevant exchange. Though it seemed more ...
2
votes
2answers
53 views

API naming for authentication API composed by many steps

I have an API which include a registration and login process. Both process have an authentication sub-process. This sub-process are many steps which API validate a client specific data. I have many ...
1
vote
0answers
41 views

How to store the state of an IoT device in a REST backend?

I'm facing a very simple scenario that should have a simple solution, but can't seem to figure it out. I'm trying to design a RESTful app that replaces a (stateful) remote for an electrical appliance....
1
vote
1answer
82 views

Designing low fault software rest API calls to achieve data synchronization between two different systems

I have been looking for a better design approach and will be providing my problem statement here with a similar example. As I don't have logic already in place but have the solution in mind which I ...
3
votes
4answers
150 views

How to model correctly a non persistent action via REST API

Hi I have a Order this order needs to be sent to an order system. There are several oprations that can be performed. Create Modify Check-Modification (this happens on existing order) Simulate ...
0
votes
1answer
24 views

API Request/Response Model for showing differences in JSON objects

I am writing an API to merge two different JSON Objects. Both of these objects can have same as well different number of properties. Object 1 : { "name": "Sam", "lastName": "Hanks", "...
0
votes
1answer
91 views

Should REST API rate limiting specifics be told to the caller?

I have an REST API, which has a rate limit of 1 query per IP per 5 seconds. When the user tries to call the API too often, I respond with the HTTP status code 429 Too Many Requests and a JSON message. ...
1
vote
3answers
92 views

Is RPC itself a network protocol?

Design Data Intensive Applications compares RPC and REST. It says The RPC model tries to make a request to a remote network service look the same as calling a function or method in your programming ...
2
votes
3answers
101 views

Rest application header based vs path based service routing

i have a rest API that is a front end to a more complex SOAP based service. The soap based service uses extended(custom) WSA-addressing headers in order to perform its routing. The extension of the ...
1
vote
1answer
115 views

Background job in microservices

I have a basic java Dropwizard service within cluster of microservices. It manages user resources with restful api styles. Let's call it user-app Then there is a new operation / api endpoint that ...
0
votes
1answer
34 views

Appropriates names for Api implementation and Api Client Library

Suppose I have a big project, called Northwind. It's a website in front of a database. Now management want me to create a public API for this. I create a new ASP.NET Core project called Northwind.Api ...
1
vote
0answers
11 views

Hypertext Application Language grouping items in a collection

For the purposes of this question I can use an example document straight from the HAL spec, since my problem is very similar: { "_links": { "self": { "href": "/orders" }, "next": { ...
2
votes
1answer
62 views

Should I use Repositories or wrap that logic in an additional service layer in my Controllers

I am building a Loopback4 app just for learning; I have a scenario where I have to check for a couple of things before sending that request to the database, so my entry point is my Controllers Method, ...
2
votes
2answers
97 views

Elegant way to relate two php scripts

I have been writing some code in PHP for a bit of time, but I am still pretty new on it. I have a script with all functions I need for my webapp. The script looks like this? function foo(bar){...} ...
1
vote
1answer
71 views

Why does the Django Rest Framework encourage separating Model, Serializer and Views for the same object across multiple files?

Summary: Why shouldn't I put model, serializer and view classes for the same object in the same file in my Django Rest Framework application? I'm building an application using the Django Rest ...
1
vote
4answers
112 views

REST API include permissions into resource

We currently have REST API, where you have a set of different resources, like: GET /cats GET /cats/{catId} GET /dogs Clients decide whether they can perform an action based on resource permissions. ...
-3
votes
1answer
242 views

How do I overcome the limit of 4000 results returned from the REST API?

I have an application which records the company man hours of employees and other related details. Because it gets updated everyday or when a new employee is added, it tends to lead to a very large ...
2
votes
4answers
160 views

Alternatives to polling an API

Assume we have a desktop application (probably WinForms) that acts as a client to some API for an app with a messaging function. This API has endpoints that return a JSON of messages, and who sent ...

1 2 3 4 5 25