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
13
votes
4answers
13k views

Microservices REST or AMQP, which case

I've read many articles concerning microservices architecture and I was wondering when to use AMQP or REST. I've read that loose coupling between services is a good thing and AMQP seems to be a good ...
2
votes
2answers
3k views

What API design makes the most sense for changing a user's password?

Consider a web page where a user changes his password after clicking on an emailed password reset link. The page will be implemented against an API using ajax, rather than as an ordinary form ...
-1
votes
1answer
112 views

RPC with Express JS? [closed]

I've been working on a project recently where I have an Expressjs server that supplies weather forecast data to its clients. Right now, I'm using express simply as a means of exposing some functions I ...
0
votes
0answers
31 views

How do I separate REST annotations, JSON serialization and data validation?

I have inherited a REST API and I'm looking at the best way to refactor it so that I can separate out the different architectural parts to aid: making the code base leaner, cleaner and tidier further ...
20
votes
3answers
12k views

Is it normal design to completely decouple backend and frontend web applications and allow them to communicate with (JSON) REST API?

I am creating new business web application and I want to achieve: Use the best technologies from their respective realms. I want reliable backend framework with solid ORM. And I want the most ...
0
votes
3answers
122 views

REST model sharing between client and server

Consider two facts of a typical organization: Some entities are very common (e.g. Order in a POS system) Some entities might have complex relations (e.g. Order might have a list of Items, a ...
-4
votes
1answer
166 views

Performance comparison of Legacy VB6 Software vs Node.js and React.js

My company just started a new production management software by using serial communication to scales. My company has already developed the software using VB6 in 2006 and keep using that outdated ...
1
vote
2answers
217 views

New version of REST API - deploy two services?

Assume you need to define a completely new REST API for a given service. These rest APIs are distinguished by something like "v1" and "v2" in the path. If you develop these services in Java, would ...
0
votes
0answers
99 views

Where should the API reside?

I have a microservice(opsApiServ) which hosts API to do operations(ops). /ops - POST, GET /ops-item - GET ops-item is just a single unit of operation, and ops is collection of operations (ops-item). ...
1
vote
4answers
3k views

What are the consequences of using verbs instead of nouns in REST API URI?

For people who will use an API, is it easier to see: /createUser /getUser/id /editUser/id The standard is to use nouns in URI eg: /user/ POST (Create a user) /user/ GET (Get list of users) A ...
24
votes
4answers
5k views

Microservices and data storage

I'm considering moving a monolithic REST API to a microservice architecture, and I'm getting a bit confused about data storage. As I see it, some of the benefits of microservices would be: ...
61
votes
5answers
8k views

What does HATEOAS offer for discoverability and decoupling besides ability to change your URL structure more or less freely?

Lately I've been reading about Hypermedia as the Engine of Application State (HATEOAS), the constraint that is claimed to make a web API "truly RESTful". It boils down to basically including links ...
2
votes
3answers
104 views

Design: Where should methods specific to a model, but not an instance go?

Let's say I have a User model defined. It makes sense that methods for retrieving certain fields of this model lives in the model file. My question is where something that generates a unique UUID, or ...
2
votes
3answers
206 views

Is something like “answers/{id}/downvote” considered RESTful?

Looking at Stack Exchange API docs, I see methods like answers/{id}/downvote answers/{id}/downvote/undo comments/{id}/delete. Should this be considered a RESTful API? (The docs does not mention the ...
2
votes
1answer
252 views

Long running server process. How to update client

What I'm looking for is a pattern for the client triggering a server process, then the server process signalling the client when its finished. preferably with examples available in .NET or dotnetcore ...
-2
votes
2answers
69 views

REST API acceptable design flexibility

I design and works on lot of projects involves REST APIs. But one question is always occur to me if it is acceptable way to do REST. So according to REST manuals online, REST is build upon two major ...
0
votes
1answer
48 views

Retrieving JSON and image representation of a resource

I am developing a RESTful API designed primarily (but not exclusively) for consumption by a web application. For the purposes of this question, the API is a set of GET endpoints. The main endpoint is /...
0
votes
0answers
163 views

Separating models in a Backend-For-Frontend (BFF) API

At the moment I have a frontend client calling several backend REST APIs. For example a call may be to get information about a certain vehicle. Then the client will call REST API A to get some ...
2
votes
2answers
2k views

RESTful API Relationships

Lets say we are making an API with two resources: Author and Book where books can have many authors and authors can have many books. So we design the REST api like so: /books /books/:id /books/:id/...
-1
votes
2answers
100 views

Use different webservers for REST interface and HTML?

An application provides a REST interface to offer status and statistics information. localhost:1111/stats -> return JSON encoded statistics localhost:1111/status -> return JSON encoded system ...
132
votes
7answers
69k views

How do searches fit into a RESTful interface?

When designing a RESTful interface, the semantics of the request types are deemed vital to the design. GET - List collection or retrieve element PUT - Replace collection or element POST - Create ...
0
votes
0answers
25 views

How to provide an extension point for library that should authenticate asynchronously using WebClient?

I'm trying to design a library (nuget package) that would read data from a REST API and deserialize it to DTO objects. The API requires authentication which is usually done with Microsoft's ADAL ...
1
vote
2answers
89 views

DDD aggregates, entities, REST and how they all fit together

I'm trying to apply DDD principles to an application that has a REST API in front and is backed by an SQL storage. Here's the entity structure I have come up with so far: Client: 1 ---- * Contract: ...
1
vote
1answer
55 views

Using frameworks that map database to RESTful APIs?

While researching RESTful API frameworks I've come across (generally speaking) two types of frameworks: The first type will (more or less) directly (or nearly directly) map an ORM/ODM scheme of your ...
0
votes
1answer
106 views

Storing session data on client or server side

I have an Android application that communicates with the server using REST. During the flow, the client(Android) usually send 3 separate requests to the server with different data. Some of the data ...
0
votes
0answers
70 views

HTTP Method and REST URL for Returning Data that May Be Saved

My application has a grid with a list of Car objects from a third party system [{id: 1, make: "Ford", model: "Focus", ...},...] The user can select a Car and use its data (after some transformation)...
1
vote
3answers
239 views

How to integrate different “microservices” into a transaction?

We're building a new web-based industrial application and one of the questions that are hammering our heads for the last few days is about the integration between different "microservices" on this ...
3
votes
1answer
55 views

Handling field masks on the statically typed client

Let's say I have a REST API, that has the ability to provide field mask (i.e. the API can return M out of N attributes where M is a subset of N). If a statically typed client (example: one that's ...
0
votes
0answers
27 views

what's the proper way to interpret SREM results from REDIS

Background I am writing a REST API that exposes a method that allows the caller to delete a resource from the REDIS database. Because I'm using a SET, when you try to do an SREM, it will just return ...
2
votes
2answers
276 views

Should I provide client libraries in some select languages along with the APIs themselves?

Say I have created a web service based on RESTful APIs. Does it make sense to also provide users with a client library for the API in some select languages which are likely to be the most used ones? ...
3
votes
1answer
544 views

Push notification from web application to my mobile app

I want to create a mobile app(iOS and Android) for business need, ex: the business is Health and Beauty. So I need a mobile app for sale some goods and service. However, I need push notification to ...
2
votes
1answer
307 views

REST API URL parameter

We've come across the following case when working on REST API. Users have the ability to expand the product deployment by installing custom JSON configurations. These configurations tend to be ...
2
votes
3answers
126 views

Permissive vs. Strict API Message validation

We had a interesting debate today over what our REST API should default to doing when validating a request body where unexpected fields are present. I think we ended the conversation in a good place, ...
-2
votes
1answer
461 views

How @RolesAllowed annotation is workin in Java [closed]

I know that @RolesAllowd annotation can be used to provide role-based access control to REST endpoints and I am currently using that with RestEASY. I need to know how it is working behind the scenes....
0
votes
0answers
47 views

WebAPI Versioning practice - Common version to all controllers

I am using Microsoft.AspNet.WebApi.Versioning for versioning my WebAPI project. I already used version through the header with CustomControllerSelector class. After learning this package, I am ...
0
votes
1answer
189 views

URL API design considerations and REST action

We have a cart and cart has line items, now line items can be products, discount coupons, rewards and promotions. I am looking for some inputs in design consideration here. The backend is in Ruby on ...
0
votes
0answers
36 views

HTTP/REST and chained processing protocol/convention

Is there a protocol or a convention that supports REST (ok, maybe we should use HTTP here instead) processing chain and some neat features to help with that? Let me explain what I mean. Let's assume ...
23
votes
2answers
17k views

Why does convention say DB table names should be singular but RESTful resources plural?

It's a pretty established convention that database table names, in SQL at least, should be singular. SELECT * FROM user; See this question and discussion. It's also a pretty established convention ...
8
votes
2answers
569 views

What does “HATEOAS” have to do with Application State?

HATEOAS is an acronym for "Hypermedia As The Engine Of Application State". What is the "Engine of Application State" referring to, and particularly - how is "hypermedia" the engine of it? As far as I ...
1
vote
2answers
148 views

Is it okay to use a 'HttpPut' or 'HttpPatch' verb and allow the API method not to check for a Patch doc or resource?

I'm not sure what the correct procedure is, when you have a question based off an answer you read but it is a seperate question that arose because of the answer provided. the answer in question Which ...
0
votes
1answer
112 views

Which is better solution - having separate model class against each REST API or keep adding info in single object?

I have a class Person. Person { String firstName; String lastName; String Date dob; String email; String mobileNumber; String address; } To add a person, I have following REST APIs: POST /...
1
vote
0answers
39 views

API Response in APP

How can we capture the response from REST API. Here is what I am doing: React JS page which contains the button for login. As soon as you click login it will redirect to Ping Identity Login page. On ...
0
votes
2answers
141 views

Wait time created by having separated REST API and web application

I created a new Asp.Net MVC web project. I took the decision to create two different apps, the first one would be a web REST API that would provide all data for the second one, which would essentially ...
-2
votes
1answer
188 views

How to deal with very large file in request body in REST API?

I have created a rest api. It supports multipart/form-data request type. My API clients used to attach content of files in their system to POST request body. It works fine. But recently there is need ...
2
votes
4answers
413 views

Check if resource exists before inserting to the database or wait until the DAO throw the Exception?

I have two paths: /students /students/{id}/addresses ...with the following behavior: POST to /students - 201 Created (if successfully created the Student) POST to /students/{id}/addresses - 201 ...
0
votes
1answer
77 views

Multiple sessions accessing localhost database

I do not how to ask the question, but I am confused by how to manage sessions when the server is at local host. Accessing the database direct Without a middleware (REST), sessions are created as ...
72
votes
7answers
167k views

Designing a REST api by URI vs query string

Let's say I have three resources that are related like so: Grandparent (collection) -> Parent (collection) -> and Child (collection) The above depicts the relationship among these resources ...
2
votes
6answers
232 views

Difference between REST & HTTP REST implementations

REST principles are described here: https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2 https://en.wikipedia.org/wiki/Representational_state_transfer#...
5
votes
2answers
943 views

Which is the best option to exchange large amount of data in a micro-service architecture?

Application I am working on requires text contents to be extracted from various proprietary document formats like Microsoft word documents (doc, ppt, xls ), pdf and etc. I am planning to implement a ...
1
vote
1answer
130 views

Is GraphQL REST compliant (almost)?

I am writing an article about traditional REST vs GraphQL. However, after doing some research about REST (not just a specific implementation of REST), I started to see that GraphQL actually abides to ...