Representational state transfer, or REST, is an architectural style for networking software to transfer information through the web.

learn more… | top users | synonyms

-1
votes
1answer
77 views

Considerations about returning text instead of JSON in a JSON compliant API [closed]

I'm using Spring-Boot + Jackson to implement a Rest API. When I return some object from my methods the controllers are building a JSON compliant response. However, that's not happening when I return ...
25
votes
5answers
37k 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
2answers
113 views

Scaling a Restful Web Service Hosted in Server

We have deployed a restful web service on a application server (Apache). The volume is getting higher and we do want to scale it. We will deploy two more Apache instances on two more machines. How do ...
1
vote
3answers
660 views

Best way to deal with Hibernate 1->Many relationship over REST/JSON service

Problem: A Hibernate bi-directional One-to-Many relationship does not map easily to JSON. If default (Jackson) mapping is used there is an infinite recursion issue as the parent contains the children ...
3
votes
2answers
166 views

REST API - omitted properties in POST request: How should they be handled?

Given the following scenario: Teacher entity { "id": "1234", "name": "Mr. Didactic", "Subject": "History", "Classroom": "1A" } REST API endpoint: /teacher/id/1234 Let's say I submit ...
0
votes
0answers
78 views

Is pure RESTful required for Angular JS / Backend running on same web server?

I am developing an application with Sprintboot + REST + Angular. While I am working on the REST API, I am trying to design as RESTful as possible. I'm encountering certain pages where the Angular UI ...
0
votes
1answer
142 views

Relationship between REST APIs and Databases [duplicate]

I've been studying databases and rest APIs lately and I have a question about the relationship between the two. Imagine I have a database with three tables, STUDENTS, ENROLLED, and CLASSES. STUDENTS ...
3
votes
0answers
79 views

Sharing identical events, with differing scopes, between client and server libraries, in a micro-service architecture

I have a shared user repository (id, name, e-mail, password, etc.) exposed as a REST service - and multiple independent web-sites accessing this REST service (from the back-end) as a means of sharing ...
8
votes
2answers
3k views

What is the best pattern for adding an existing item to a collection in REST API?

I'm designing a pragmatic REST API and I'm a little stuck on how best to add existing entities to a collection. My domain model includes a Project that has a collection of Sites. This is a strict many-...
78
votes
5answers
87k views

Difference between REST and CRUD

I learned REST and it feels a lot like CRUD (from what I have read about CRUD). I know they are different, and I wonder if thinking they are similar means I don't understand them. Is it that REST is ...
3
votes
5answers
139 views

Bulk update: return all results or only failures

I'm developing an API that performs bulk update of a large number of items in a single call. This code will consist of a REST endpoint and the internal library code that it calls. There are a few ...
3
votes
2answers
766 views

How can I create a RESTful-style website if HTML forms only allow to use GET and POST?

Let's say that I want to create a website where users will be able to create, edit and delete some kind of resources, for example posts. I have created a RESTful API, so user can create a post by ...
2
votes
5answers
580 views

API design dilemma: to REST or not to REST

I'd like to design a REST API supporting: Login Temporary token generation The reason being there are a number of client-side REST libraries that would speed up development if used, as they take ...
3
votes
1answer
147 views

How to paginate local and remote data?

My team is currently facing a problem that we don't know how to tackle. Some technical details: we use Java 8, Hibernate, Spring, MySQL, and AngularJS for the front-end. We need to do pagination on ...
1
vote
2answers
96 views

What is really a resource?

I'm starting to study about web api's and REST and I'm having a hard time to understand what is really a resource. Basically the book I'm reading says that a resource is a conceptual mapping to one or ...
16
votes
3answers
1k views

Conceptual mismatch between DDD Application Services and REST API

I'm trying to design an application that has a complex business domain and a requirement to support a REST API (not strictly REST, but resource-oriented). I have some trouble coming up with a way to ...
1
vote
1answer
108 views

Richardson Maturity Level 3. What about form input

In many ways RMM level 3 is similar to the world wide web we know where every resource is available with the click of a link. In www we have links, but we also have forms where a form with method="...
0
votes
5answers
371 views

Handling DomainExceptions using REST endpoint

Suppose I'm doing some DDD. Now, I have a microservice reflecting a bounded context/a part of a bounded context. Now, suppose there is a REST endpoint: '/somedomainmodel/someaction' My API user is ...
2
votes
2answers
146 views

REST API - Handling subresources

Suppose there is a primary resource "/accounts" which has Profile (name, national id, DOB), addresses and contacts(email, phones). I am considering them as sub-resources because they cannot exist ...
6
votes
5answers
605 views

How to design a complex REST API considering DB performance?

I've been following some tutorials on how to design REST APIs, but I still have some big questions marks. All these tutorials show resources with relatively simple hierarchies, and I would like to ...
2
votes
1answer
83 views

REST Standard for changing SPA Model after fetched from REST API

Let's imagine. I have following data from database. ====================================== id | Title | parentId ====================================== 100 Asia NULL ----------...
2
votes
1answer
362 views

Consuming REST services: client or server

I am working on a new project in which we are currently deciding which technologies and frameworks we will be using. The application will eventually be cross platform. Therefore, for the server side, ...
2
votes
2answers
210 views

REST API paging via headers

Let's say I have REST API which provides me list of something and I want to implement paging support - possibility to tell "give me records 20-29 (page 3)". Currently, I don't care about ...
0
votes
4answers
844 views

How do I design my application to use REST for itself?

I'm not sure how to ask this. I know this is simplistic, but I understand (I think): REST is an architecture, not required, simply a way to build REST is a style and a community standard for ...
1
vote
1answer
324 views

Web Api design - Using Nouns vs verbs

I have this design situation at work. We have a internal Web-Api application and a Asp.Net Web forms application(UI). The web-application is calling Web-Api to update a Contractor. public Class ...
1
vote
1answer
88 views

Design - shallow routes for an API

I am building an API that will connect to multiple databases. I am using Emberjs on the front end and the default rest adapter seems to prefer shallow routes. Say, I have the following routes api/...
1
vote
2answers
69 views

Difficult design with multiple associations between two entities

I'm trying to design the data schema and the restful api for a specific case. In my system I have several users and several books. Every book can have several users as authors and at the same time ...
3
votes
2answers
103 views

Status transitions with extra information in RESTful interfaces

How would you design a REST interface that triggers a status change of an object, but requires additional properties in that moment? For example, the deliverer of a package needs to change the status ...
5
votes
1answer
183 views

Does discoverability in HATEOAS require the information must be machine readable, or can it just be human readable?

I'm trying to understand the concepts of HATEOAS (Hypermedia As The Engine Of Application State) in REST. The following have been very useful: What does HATEOAS offer for discoverability and ...
48
votes
3answers
5k 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 ...
4
votes
1answer
161 views

Filtering request and responses in RESTful MEAN stack

I have a very basic RESTful service written using the MEAN stack (MongoDb, Express.js, Angular.js, Node.js) and utilizing the Mongoose ODM. Product schema var productSchema = new mongoose.Schema({ ...
3
votes
2answers
283 views

In REST is HATEOAS really about self-discovery or about navigation? [duplicate]

I'm trying to learn about REST and having problems with the concept of HATEOAS (Hypermedia As The Engine Of Application State). What is it for? It seems to me the majority of commenters on the web ...
1
vote
0answers
30 views

Restful flows for data entry

I'm considering a few different possible flows for a restful api. For minimum viable product, I'm assuming a web browser as the front end. Current use case: the task of the human operator is to ...
1
vote
2answers
76 views

Should a client check for persisted item existence before modifying it?

I'm developing a MVC Web application with a REST interface. The REST controller performs actions on persisted items through a service class, which translates exceptions coming from the persistence ...
3
votes
2answers
175 views

How are POST/PUT/DELETE data passed to APIs?

I know that the data is passed through HTTP, but I'm not sure if I should be passing data through HTTP headers, or HTTP bodies. Which one is the convention for APIs? Also, theoretically using PHP, ...
3
votes
3answers
2k 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 losing couple between services is a good thing and AMQP seems to be a good ...
2
votes
3answers
440 views

Are colons ok in a REST API?

I see many REST API examples with URIs like http://<whatever>/widgets or http://<whatever>/widget/123, for a specific thing. For most things I would just stick with the front slash, but ...
2
votes
2answers
442 views

How to correctly implement key=value storage REST API

I'm new to REST API, so I decided to get familiar with it by designing a small web service API. I have its design written down and would like you to review it. I feel like I have made some mistakes in ...
4
votes
1answer
290 views

Resource representations and REST API documentation tools

I find myself unsure about what exactly it means to have different representations of a RESTful resource. The canonical example is for an API to provide an endpoint - say /v1/users/:id - and allow ...
2
votes
3answers
606 views

Testing front-end app that hits a REST service

A lot of questions about testing here... And I have another one. Forgive me, but I want to make sure I do this right. Let's say I have a front-end application, be it a mobile app, or a single-page ...
4
votes
2answers
219 views

Should a RESTful API be able to return files, or just a location

This has been puzzling me for a while. For example, we have a REST API that provides basic content to a system, consuming and producing JSON. At this endpoint it produces a URL to a picture and a ...
5
votes
1answer
204 views

What is the most efficient way to implement a RESTful client app?

I am working on a web application for ranking some products based on some factors. The user send a search query to 5 restful webservices which by their turn send a response in a JSON format and ...
2
votes
1answer
115 views

Tracking online users with a stateless architecture

I own a stateless architecture, exchanging a JWT token between client and server at authentication time. I want to store in database (once per day) a timestamp related to the user access. Indeed, I ...
4
votes
1answer
263 views

Many asynchronous calls vs single call to the API

We are developing a REST API which among others is going to be consumed by an HTML5 frontend via javascript. The application is for use within the organization and usually has about 300 users, but we ...
0
votes
2answers
189 views

JSON API specification : When do I need to return a 404 not found?

I'm working on a REST api following the JSON api specification and I'm struggling with the "no data" responses (described here). A server MUST respond with 404 Not Found when processing a request ...
3
votes
1answer
348 views

why use authentication token instead of session_id for app(android side) in REST API

in normal php web application after login we use session_id that came from web browser to check if user loged in or not. But in REST API authentication I read some tutorials that say php should send ...
4
votes
2answers
813 views

Best practice to handle POST with array of objects if at least one object raise an Exception

I want to POST an array of objects and make an insertion in database concerning each of them. What is the best practice if one object does not conform and raise an Exception? (cancel all transactions ...
3
votes
0answers
136 views

How to make sure media are used only on authorised sites?

I have a video library that I need to publish for my clients. The clients need to be able to embed a player to their sites and play the videos. I need to restrict access to my clients only so that no ...
3
votes
1answer
137 views

Is having only static pages calling the backend a good idea?

I'm new to web applications development, specially when it comes to frontend, but as I understood, a typical structure for a big application would have a frontend php (or equivalent) layer calling the ...
4
votes
1answer
304 views

Best practice for Restful API that perform heavy calculations (Image Processing)

We are currently developing an image processing restful api. Server performs some CPU-heavy computations image processing upon request and return the image to the client. We want to make this a ...