Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rest]

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

0
votes
0answers
7 views

RPC with Express JS?

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 ...
-1
votes
0answers
16 views

Interfaces or concrete classes for REST API models?

I'm working on a project composed of a few modules providing backend services, and a REST API application to access them. All the backend services consume and produce interfaces, which are also JAXB ...
0
votes
1answer
45 views

Synchronize multiples REST api, centralized into 1 web application

I am developing a web application for a client, connected to 4 differents sources : E-commerce website CRM Emailing platform Surveys platform All the sources have REST Api's. The web application ...
2
votes
3answers
101 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
202 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
2answers
64 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 ...
2
votes
1answer
104 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 ...
0
votes
1answer
25 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
22 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
0answers
44 views

design java library to make HTTP request

I want to create a jar library to be used in another project (Concurrent access), this library aims to run multiple tasks each task is an HTTP request. I create a class for each Task, each class ...
1
vote
1answer
48 views

Web API POST: single item vs collection

No code to show (and not really a code issue) but I have an iot-ish application running that is using PI Zeroes as clients and they are slow. A single POST takes about 10 seconds round trip, the delay ...
0
votes
0answers
20 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
votes
2answers
99 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 ...
1
vote
2answers
49 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
48 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
0answers
62 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
163 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 ...
0
votes
0answers
13 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
3answers
81 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, ...
-3
votes
1answer
65 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
23 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
0answers
34 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 ...
1
vote
2answers
54 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
83 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 /...
8
votes
2answers
351 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
0answers
37 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 ...
-2
votes
1answer
34 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 ...
0
votes
1answer
48 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 ...
2
votes
4answers
137 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
64 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 ...
2
votes
6answers
225 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#...
1
vote
1answer
73 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 ...
0
votes
2answers
53 views

How do job queues return results to UI?

I am working on an app that will run queries and return results to UI. However, these queries can take a long time to finish so I should not wait for the result. As far as I know, people use task ...
2
votes
1answer
157 views

Communication in a microservices architecture with flask and REST

Components involved: Mobile Client Microservices API Gateway Each microservice is a Flask application exposing a RESTful API. When a request is made by the mobile client, it is sent to the API ...
3
votes
1answer
49 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 ...
1
vote
1answer
54 views

Listing all sub-resources without parent scope

Let's say I have User resource which has Address sub-resource (let's forget about why this is a resource instead of attribute). To get a user's address, I can do GET /users/{id}/address Now I want to ...
-1
votes
1answer
70 views

Any solution for scheduling a “high volume traffic” mode on API?

I have been wondering if there is any way to design and develop a mechanism for a REST API for scheduling some sort of "high volume" traffic so it does not conflict with normal rate-limiting. This ...
1
vote
2answers
78 views

API design - indicate that results were truncated

For reasons, my search endpoint returns a maximum of 50 results. I'm struggling with how best to tell the caller that their results were limited to 50. The best I've come up with is returning some ...
0
votes
0answers
36 views

How to properly structure a REST API for other sites to use that has user accounts?

I need to build a REST/HTTP API that has user accounts that other sites can use. It is my understanding that it is incorrect for the other sites(that use our API) to use a password field to allow ...
1
vote
5answers
220 views

Correct usage of HTTP VERBS in custom REST implementation

I have a server-side service (using ASP.NET Core) that should provide a REST API to various clients. Behind the service, I use a SQL server for data storage. The controller has the following route ...
0
votes
1answer
67 views

Best route naming convention when a RESTful GET needs to be a POST

I have a REST API that has been built on top (in front of) a legacy system, to allow 3rd parties of various platforms to interact with the system. Most of the time, I can define a resource and create ...
0
votes
1answer
103 views

Point-to-Point integration vs ESB

We have a system which has been in development for 10+ years and still continues. It is built as an SOA and use SOAP. We have a new client, internally within our company, who wants to integrate with ...
1
vote
2answers
213 views

Why should I follow the standard REST API best practices/guidelines?

I found the standard REST API best practices to be very confusing, because you need to know all the HTTP methods such as GET/POST/PUT/DELETE/PATCH etc. Not only that, while calling an API, you might ...
0
votes
1answer
36 views

What to include in a (Batch) POST/PATCH results/errors for results for pragmatic REST API

This is really a question about "best" or "practical" practices, and would be interested if anyone else has had a similar need as myself, and how they handled it. I have a REST(ish) API that we have ...
3
votes
1answer
125 views

Best practice for REST result payload when field may have single or multiple values

I Have a REST API endpoint where the caller can supply some optional filters for the results. GET api/inventory For example, an object member of a GET request may look like the following { "...
1
vote
2answers
118 views

Security Issues with RESTful Authentication & Session Management

I'm trying to implement authentication and session management for a microservice. In order to do the process RESTfully, I understand that I'll need to use some kind of token-based authentication to ...
1
vote
3answers
181 views

How can I represent something like “latest news” in REST api?

Can't figure out how. 1) Resource identification. How do I identify the resource? Something like this? /latest_news/<id> That doesn't seem right. 2) Now suppose you have a URL for the ...
1
vote
0answers
46 views

How to define REST endpoint for subresource of not saved resource

I have REST API for my SPA application. My domain model has Order entity, it has Commission property which calculated on backend, it is number value For get Order entity SPA calls this endpoint, this ...
-3
votes
1answer
70 views

Monitoring my REST API service

I have a REST API. I want to monitor it -- that it's always up. That's the canonical way to ping it? Especially when all of its calls require an API key. Should I create an empty open end point ...
4
votes
5answers
406 views

Should we tailor APIs to the customer, or ask the customer to use the existing one?

I am a sole developer and I recently wrote a new web application in the form of a API with Swagger and front-end. This was customers could use the API on their own, usually forscripting. It is ...