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

learn more… | top users | synonyms

3
votes
1answer
454 views

REST vs RPC for mobile development

As many know, mobile development is skyrocketing these days and, I believe, it affects what we code. To be specific, I am interested in developing web services for a mobile application. I see two ...
3
votes
1answer
827 views

Is MVC the optimal pattern to build a RESTful web service?

Not being a Java practitioner, I recently came to learn about the JAX-RS specification and Apache CXF framework. While still wrapping my head around all these things, I also read the this question on ...
0
votes
0answers
65 views

How to properly design REST [duplicate]

I intensively work with REST architecture about last year. And I don't stop a wonder how REST is inflexible or may I can't understand how to properly use it. So I use REST services on my backend and ...
3
votes
2answers
315 views

RESTful URI's, Creating a new noun/uri or add a queryparameter

I have a Person class with a one to many relationship to Employment. A Person in the CRM can have multiple Employments (historic data). My current REST URI for this class looks like this: ...
1
vote
1answer
445 views

How to decide the token expiry time in REST web service

I am working on creating a REST ws exposing few API's. A token is required for each API call. I am confused about the expiry time to be set for the token. Security+Performance wise what is the ideal ...
7
votes
3answers
2k views

Are there any problems with implementing custom HTTP methods?

We have a URL in the following format /instance/{instanceType}/{instanceId} You can call it with the standard HTTP methods: POST, GET, DELETE, PUT. However, there are a few more actions that we ...
3
votes
2answers
3k views

Custom use of Authorization header in a REST API

I'm building a REST api where clients are authenticated using client certificates. A client in this case is not an individual user, but some sort of a presentation layer. Users are authenticated using ...
5
votes
1answer
624 views

Best practice for handling asynchronous inter communication?

Recently completed a project for handling credit card processing. One of the difficulties I faced was handling the delay / possible failure of notification messages. The most complex example was: an ...
5
votes
1answer
6k views

How can I unit-test my REST web service?

I am new to unit testing, I've one REST web method that just calls DB and populates a DTO. Pseudo code is public object GetCustomer(int id) { CustomerDTO objCust = //get from DB return objCust; } ...
4
votes
1answer
1k views

Is it OK to partially change a collection with PUT or DELETE?

I have a collection of products in a product group e.g.: product-groups/123/products If I need to add to the collection, is it OK that I pass only some products with PUT? If I need to delete some ...
2
votes
2answers
127 views

What endpoints should I provide, if any, to permit connectivity testing for my web services?

What endpoints should I provide, if any, to permit connectivity / availability testing for my web services / Web API? TL;DR I am developing both the server and client in an enterprise environment. ...
5
votes
2answers
1k views

Can REST API be used as business layer?

I am using PHP Codeigniter MVC design pattern and I had this project with some sort of specific business processes In my application I will be dealing with 2 existing REST APIs: Google Trello ...
2
votes
2answers
809 views

Which is simpler for REST client call to return JSON - JQuery/JavaScript or Spring RestTemplate? [closed]

I've been trying to hack up an annotated Spring MVC web app but it's proving pretty hard to call a URL of my web app which fires a request to a remote API (UK Police data) and recieves a reply which I ...
6
votes
6answers
3k views

Testing a REST client against a REST Server. How to do fixtures?

When writing unit tests, it's common to use fixtures: little testable data, so we can say: 1. Get all clients should include Willy Wonka. 2. Delete client 3, and now get clients should not include ...
4
votes
1answer
727 views

How to achieve N-Tier type in Codeigniter MVC [closed]

I know that N-Tier intended to separate layers on different network but I would like to have the same code separation in codeigniter I got this idea to have Model : for database CRUD - > Data layer ...
1
vote
2answers
248 views

Managing Alerts in Web Application Using RESTful API

I have designed a RESTful API and I am now working on creating a web application to use the service. One thing I am struggling with is how to manage alerts in the web application (similar to the ...
2
votes
2answers
266 views

How to make my web app restful

I have a web application which I want to make RESTful. Here is the structure of the app: Top level has a bunch of search screens, they are basically tabs which search different parts of database ...
3
votes
1answer
2k views

Should web service response use a base class or generic class?

In my RESTful WCF web service I have something like the following response object. public class WebResponse<T> { public bool Success { get; set; } public T Data { get; set; } ...
2
votes
1answer
357 views

Sub-Resource data should be embedded in Resource entity or duplicated in NoSQL document?

I have a scenario similar to as depicted below, public class Post { private int id; private int postType; private int score; private User originalPoster; private String title; ...
12
votes
7answers
6k views

A Web application as a REST API client: how to handle resource identifiers

Several concepts related to REST conflict in my head when I try implementing it. I have a REST-ful back-end API system that holds the business logic, and a web application that provides the UI. From ...
1
vote
2answers
287 views

Is it possible to use a “non-commercial” REST API in a for-pay app?

I am interested in integrating the results of 3rd-party news API's into my for-pay application. The APIs would be a very small part of the app (e. g. the app is not just reselling the APIs). I have ...
6
votes
1answer
3k views

When to use nested resources in a RESTful API

I have two resources: users and links. Users can have several links associated with them. I have designed my RESTful API so that you can reach the links associated with a user at the following URI: ...
1
vote
1answer
248 views

Database data structures for RESTful api

I am creating a RESTful API. I am struggling to decide on the best way to design my database tables around my resources. Initially, I though a table per resource would be a good way to go, but I'm ...
10
votes
2answers
4k views

Trailing slash in RESTful API

I have been having a debate about what to do with a trailing slash in a RESTful API. Lets say I have a resource called dogs and subordinate resources for individual dogs. We can therefore do the ...
0
votes
0answers
431 views

design pattern to expose MongoDB to REST api?

We are setting up something like a document library on Amazon AWS. The architecture is basically 1. AMI server running MongoDB 2. A bunch of PDF documents on elastic block storage 3. Some server-side ...
8
votes
7answers
1k views

Will Authentication over HTTPS Slow My Application?

I am building a web application and RESTful web service. I have been reading various articles about the best way to authenticate the requests to the web service. The best option for me seems to be ...
1
vote
1answer
112 views

What's a good strategy for managing static data in an SOA?

I'm working on a web application that sits on top of a number of RESTful web services, interacting primarily with those services through JSON formatted messages over HTTP. Our application has a great ...
-1
votes
1answer
557 views

Appropriate selection of security framework [closed]

I have a web application to be developed using RESTeasy API and for this I have to implement security (Form based authentication). So i am not sure about the most appropriate fit for this. As I ...
2
votes
3answers
337 views

RESTful Design: Multiple Relationships Between the Same 2 Entities

I am in the process of designing RESTful web services and got stuck at one point. The design is very simple with 3 entities: - Project - Status - Employee The part I am having trouble with is ...
7
votes
2answers
3k views

Implementing the command pattern in a RESTful API

I'm in the process of designing an HTTP API, hopefully making it as RESTful as possible. There are some actions which functionality spreads over a few resources, and sometime needs to be undone. I ...
14
votes
3answers
819 views

Does decoupling trump DRY in REST?

I am building a REST API to expose most of functionality of an existing Java API. Both APIs are for internal use within my organization; I do not have to design for external use. I have influence ...
5
votes
3answers
5k views

The best way to implement authorization for a REST API

We develop social-based applications for mobile. Every application consumes RESTful API web-services. When I implement login I usually store the username and password somewhere on device. Then I send ...
6
votes
1answer
8k views

PHP Framework for RESTful Web Service [closed]

I have been going round in circles with this question for days - which is the best PHP framework to use to create a RESTful Web service? I've trawled the web for info and have come across three main ...
6
votes
2answers
397 views

Versioned Resources to Improve Cacheability

Here's an API concept which could be useful for performance optimisation. It's an example of key-based cache expiry applied to a broader internet-wide context instead of the internal Memcached-style ...
8
votes
3answers
2k views

Represent actions(verbs) in REST URI

I have a print operation to perform for my customer documents. I need the other standard operations to be performed as well, like add,update, delete. so, I have following: For creating new ...
10
votes
7answers
2k views

Is this “anti-pattern” and should I stop using it or is this clever design?

I've basically stared to do the following when creating a REST service: HTML is requested service returns the desired web page but without the requested "resource", eg. data web page contains ...
13
votes
3answers
4k views

When are RPC-ish approaches more appropriate than REST?

After watching this talk on REST, Reuse and Serendipity by Steve Vinoski, I wonder if there are business cases in greenfield projects for (XML-)RPC-ish setups, that REST could not solve in a better ...
2
votes
1answer
236 views

REST efficiency on count and sum methods

For example, if I have a Customer Transactions Table and I create a REST for it. The fields are: date, description, and total_amount. I am trying to figure out which one is much more efficient when ...
10
votes
3answers
832 views

How to do external API testing (blackbox)

Assume you are using APIs from a vendor, how to make sure their API is working as expected? My main concern is sometimes the vendor pushed the changes to their code and break the API, we want to have ...
2
votes
1answer
537 views

Tomcat 7 vs. ehCache Standalone Server (Glassfish) Configuration with RESTful Web Services

My requirements consist of using ehCache to send and store data via RESTful web service calls. The data can be stored in-memory or via the filesystem... Never used ehCache before so I am having some ...
4
votes
3answers
232 views

What is the right HTTP method for upvoting?

From a RESTful point of view, what is the most appropriate HTTP method for the action of upvoting a forum post (like on StackExchange)? I would say POST for voting and DELETE for canceling vote, but ...
2
votes
2answers
137 views

Allowing client to select data to return via REST interface

I have a rest service that is essentially a proxy to a variety of other services. So if I call GET /users/{id} It will get their user profile, as well as order history, and contact info, etc... all ...
2
votes
3answers
190 views

Rest Design concerning user login

To be as restful as possible, is a user login better designed using a GET or a POST on a REST webservice? And why?
4
votes
2answers
394 views

Standard -server to server- and -browser to server- authentication method

I have server with some resources; until now all these resources were requested through a browser by a human user, and the authentication was made with an username/password method, that generates a ...
1
vote
2answers
593 views

REST API wrapper - class design for 'lite' object responses

I am writing a class library to serve as a managed .NET wrapper over a REST API. I'm very new to OOP, and this task is an ideal opportunity for me to learn some OOP concepts in a real-life situation ...
4
votes
1answer
634 views

How should I handle a redirect to an identity provider during a web api data request

Scenario I have a single-page web app consisting purely of html, css, and javascript. After initial load and during use, it updates various views with data from one or more RESTful apis via ajax ...
6
votes
1answer
427 views

REST API rule about tunneling

Just read this in the REST API Rulebook: GET and POST must not be used to tunnel other request methods. Tunneling refers to any abuse of HTTP that masks or misrepresents a message’s intent and ...
9
votes
2answers
2k views

Is it reasonable for REST resources to be singular and plural?

I have been wondering if, rather than a more traditional layout like this: api/Products GET // gets product(s) by id PUT // updates product(s) by id DELETE // deletes (product(s) by id POST // ...
7
votes
1answer
2k views

Proper response for a REST insert - full new record, or just the record id value?

I'm building a REST API which allows inserts (POST, not idempotent) and updates (PUT, idempotent) requests to add/update database to our application. I'm wondering if there are any standards or best ...
1
vote
1answer
338 views

Using a random string to authenticate HMAC?

I am designing a simple webservice and want to use HMAC for authentication to the service. For the purpose of this question we have: a web service at example.com a secret key shared between a user ...