Questions tagged [restful-architecture]

RESTful, or representational state transfer, is a style of software architecture for distributed hypermedia systems such as the World Wide Web.

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web.

REST attempts to describe architectures that use HTTP or similar protocols by constraining the interface to a set of well-known, standard operations (like GET, POST, PUT, DELETE for HTTP). Here, the focus is on interacting with stateless resources, rather than messages or operations.

1187 questions
11
votes
4 answers

RESTful URLs for distinct versions of a resource

I'm having a real hard time conceptually understanding something proper concerning URLs for versioned resources. Let's say I have an application that tracks recipes in a way very similar to a version control system, like old school like RCS or…
Sloloem
  • 1,587
  • 2
  • 15
  • 37
10
votes
2 answers

REST GET endpoints returning different models based on user role

I'm currently dealing few endpoints returning different kinds of models based on permissions: For example, our business object is getting converted to either an object of type Model or AdvancedModel. public class Model { public int Property1 {get;…
user4478810
10
votes
2 answers

Good practices to propagate errors through micro services

We have a micro services architecture and we are having some discussions about how to expose internal errors to the client. Here's an example: Let's suppose we have 3 services, service A, B and C. When the client sends a request to the service A,…
Waldemar Neto
  • 826
  • 6
  • 17
10
votes
2 answers

Laravel 5 POST routes to index instead of store

I am working on a Laravel 5 RESTful API that seems not to be routing the POST requests correctly. This is my routes.php: Route::group(array('prefix' => 'api/v1'), function() { Route::resource('messages', 'IncomingMessages'); }); And this is my…
GorkaU
  • 343
  • 3
  • 13
10
votes
1 answer

Using optional complex type action parameter for a POST Web API

I am trying to write an API with the following prototype: [HttpPost] public ApplicationStatus appLogIn(string id, UserCredentials userCredentials = null) But when I make a request to this API, with or without userCredentials, I get the following…
labyrinth
  • 1,104
  • 3
  • 11
  • 32
10
votes
3 answers

Can a RESTful service return both JSON and XML for the same resource, depending on the request header?

I have a simple RESTful method which currently returns JSON representation of an object. My question is more of from the architectural perspective and not completely technical. Should a RESTful service be designed in such a way that it returns…
Nital
  • 5,784
  • 26
  • 103
  • 195
10
votes
3 answers

Are server-side MVC frameworks still relevant in single-page applications?

In a single-page application that uses Angular, it seems like most of the things are handled on the client-side. The client seems to just make restful calls to the server. Following this concept, it seems to me that my server-side will not have any…
Carven
  • 14,988
  • 29
  • 118
  • 161
10
votes
5 answers

Why is using a HTTP GET to update state on the server in a RESTful call incorrect?

OK, I know already all the reasons on paper why I should not use a HTTP GET when making a RESTful call to update the state of something on the server. Thus returning possibly different data each time. And I know this is wrong for the following 'on…
atconway
  • 20,624
  • 30
  • 159
  • 229
9
votes
3 answers

How to securely send/store password in a Spring RESTful login service

In the login service, a user is posting a json as payload to a Spring RESTful login service like below: { "username": "john", "password": "doe" } Once the Spring RESTful service receives the call, it compares the password with the one store in…
blue123
  • 2,937
  • 7
  • 27
  • 29
9
votes
1 answer

JSON API REST endpoint with permissions-restricted fields

JSON API REST endpoint with permissions-restricted fields I am working on a JSON API-compliant REST api. Some endpoints contain fields that should be restricted (read-only or not available) for certain users. What is the best way to architect the…
9
votes
3 answers

Send data to Matlab from Android/Java

I spent some time searching for a way to send data from a android application to Matlab - with no approach. I would prefer to do it with JSON via a Restful webservice. I probably have the wrong concept in mind how this is going to work. Matlab…
Ghali
  • 275
  • 3
  • 15
9
votes
1 answer

How to expose enum values in a REST API

In a mobility context of use of the API, an advanced research proposes several dynamic filters that must be returned by the server. (We don't want to make too many exchange with server to initialize our filters) In a REST api, how to expose a enum…
vincentLg
  • 325
  • 2
  • 7
9
votes
2 answers

RESTFul Flat Hierarchy vs. Dynamic Hierarchy for Search Resource

We are creating a REST API and we currently have two approaches for defining the resources. Basically we have Patients, Studies and Images where a Patient has n Studies and a Study has n Images. Hierarchical…
sandrozbinden
  • 1,577
  • 1
  • 17
  • 28
9
votes
2 answers

How to handle huge data from a REST service

We are using a REST service that returns huge data. In production, the server hardware can handle it. I need to test the REST service by getting the data on my local machine, which cannot handle the huge data. My local machine is a 4G i5. I am…
om39a
  • 1,406
  • 4
  • 20
  • 39
8
votes
3 answers

Actions vs. CRUD in REST

Is it appropriate to perform actions with REST, other than simple create (POST), read (GET), update (PUT), and delete (DELETE)? I'm kind of new to the whole RESTful theology, so bear with me, but how should I accomplish the following: I have a web…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411