Ng2-Restangular
This project is the follow-up of the Restangular. Ng2-Restangular is an Angular 2 service that simplifies common GET, POST, DELETE, and UPDATE requests with a minimum of client code. It's a perfect fit for any WebApp that consumes data from a RESTful API.
Demo
Live Demo on Plunkr Hero App. You can also check post about using ng2-restangular with restdb.io service in simple TODO Application
Current stage
Ng2-Restangular almost all functionality was transferred from the Restangular. We are open to any cooperation in terms of its further development.
Table of contents
- How do I add this to my project in angular 2?
- How do I add this to my project in angular 4?
- Dependencies
- Starter Guide
- Quick configuration for Lazy Readers
- Using Restangular
- Configuring Restangular
- Properties
- withConfig
- setBaseUrl
- setExtraFields
- setParentless
- addElementTransformer
- setTransformOnlyServerElements
- setOnElemRestangularized
- addResponseInterceptor
- addFullRequestInterceptor
- addErrorInterceptor
- setRestangularFields
- setMethodOverriders
- setDefaultRequestParams
- setFullResponse
- setDefaultHeaders
- setRequestSuffix
- setUseCannonicalId
- setPlainByDefault
- setEncodeIds
- Accessing configuration
- How to configure them globally
- How to create a Restangular service with a different configuration from the global one
- Decoupled Restangular Service
- Properties
- Methods description
- Copying elements
- Using values directly in templates with Observables
- URL Building
- Creating new Restangular Methods
- Adding Custom Methods to Collections
- Adding Custom Methods to Models
- FAQ
- How can I handle errors?
- I need to send Authorization token in EVERY Restangular request, how can I do this?
- I need to send one header in EVERY Restangular request, how can I do this?
- How can I send a delete WITHOUT a body?
- I use Mongo and the ID of the elements is _id not id as the default. Therefore requests are sent to undefined routes
- What if each of my models has a different ID name like CustomerID for Customer
- How can I send files in my request using Restangular?
- How do I handle CRUD operations in a List returned by Restangular?
- Removing an element from a collection, keeping the collection restangularized
- How can I access the unrestangularized element as well as the restangularized one?
- How can add withCredentials params to requests?
- Server Frameworks
- License
How do I add this to my project in angular 2?
You can download this by:
- Using npm and running
npm install ng2-restangular
How do I add this to my project in angular 4?
You can download this by:
- Using npm and running
npm install ng2-restangular@beta
Dependencies
Restangular depends on Angular2 and Lodash.
Starter Guide
Quick Configuration (For Lazy Readers)
This is all you need to start using all the basic Restangular features.
;;; // Function for settting the default restangular configuration { RestangularProvider; RestangularProvider;} // AppModule is the main entry point into Angular2 bootstraping process@ // later in code ... @ { } { // GET http://api.test.local/v1/users/2/accounts thisrestangularall'accounts'; }
Using Restangular
Creating Main Restangular object
There are 3 ways of creating a main Restangular object. The first one and most common one is by stating the main route of all requests. The second one is by stating the main route and object of all requests.
// Only stating main routeRestangularall'accounts' // Stating main objectRestangular // Gets a list of all of those accountsRestangular;
Lets Code with Observables!
Now that we have our main Object let's start playing with it.
// AppModule is the main entry point into Angular2 bootstraping process@ @ allAccounts; accounts; account; { } { // First way of creating a this.restangular object. Just saying the base URL let baseAccounts = thisrestangularall'accounts'; // This will query /accounts and return a observable. baseAccounts; let newAccount = name: "Gonto's account"; // POST /accounts baseAccounts; // GET to http://www.google.com/ You set the URL in this case thisrestangular; // GET to http://www.google.com/1 You set the URL in this case thisrestangular; // You can do RequestLess "connections" if you need as well // Just ONE GET to /accounts/123/buildings/456 thisrestangular; // Just ONE GET to /accounts/123/buildings thisrestangular; // Here we use Observables // GET /accounts let baseAccounts$ = baseAccounts; // Get first account let firstAccount$ = baseAccounts$; // POST /accounts/123/buildings with MyBuilding information firstAccount$ ; // GET /accounts/123/users?query=params firstAccount$ ; // Second way of creating this.restangular object. URL and ID :) var account = thisrestangular; // GET /accounts/123?single=true thisaccount = account; // POST /accounts/123/messages?param=myParam with the body of name: "My Message" account }
Here is Example of code with using promises!
@ allAccounts; accounts; account; { } { // First way of creating a this.restangular object. Just saying the base URL let baseAccounts = thisrestangularall'accounts'; // This will query /accounts and return a promise. baseAccounts; var newAccount = name: "Gonto's account"; // POST /accounts baseAccounts; // GET to http://www.google.com/ You set the URL in this case thisrestangular; // GET to http://www.google.com/1 You set the URL in this case thisrestangular; // You can do RequestLess "connections" if you need as well // Just ONE GET to /accounts/123/buildings/456 thisrestangular; // Just ONE GET to /accounts/123/buildings thisrestangular; // Here we use Promises then // GET /accounts baseAccounts; // Second way of creating this.restangular object. URL and ID :) var account = thisrestangular; // GET /accounts/123?single=true thisaccount = account; // POST /accounts/123/messages?param=myParam with the body of name: "My Message" account }
Configuring Restangular
Properties
Restangular comes with defaults for all of its properties but you can configure them. So, if you don't need to configure something, there's no need to add the configuration. You can set all these configurations in RestangularModule to change the global configuration, you can also use the withConfig method in Restangular service to create a new Restangular service with some scoped configuration or use withConfig in component to make specified Restangular
withConfig
You can configure Restangular "withConfig" like in example below, you can also configure them globally **RestangularModule or in service with withConfig
// Function for settting the default restangular configuration { RestangularProvider;} @ {}// Let's use it in the component@ {} { restangularall'users' };
setBaseUrl
The base URL for all calls to your API. For example if your URL for fetching accounts is http://example.com/api/v1/accounts, then your baseUrl is /api/v1
. The default baseUrl is an empty string which resolves to the same url that Angular2 is running, but you can also set an absolute url like http://api.example.com/api/v1
if you need to set another domain.
setExtraFields
These are the fields that you want to save from your parent resources if you need to display them. By default this is an Empty Array which will suit most cases
setParentless
Use this property to control whether Restangularized elements to have a parent or not. So, for example if you get an account and then get a nested list of buildings, you may want the buildings URL to be simple /buildings/123
instead of /accounts/123/buildings/123
. This property lets you do that.
This method accepts 1 parameter, it could be:
- Boolean: Specifies if all elements should be parentless or not
- Array: Specifies the routes (types) of all elements that should be parentless. For example
['buildings']
addElementTransformer
This is a hook. After each element has been "restangularized" (Added the new methods from Restangular), the corresponding transformer will be called if it fits.
This should be used to add your own methods / functions to entities of certain types.
You can add as many element transformers as you want. The signature of this method can be one of the following:
-
addElementTransformer(route, transformer): Transformer is called with all elements that have been restangularized, no matter if they're collections or not.
-
addElementTransformer(route, isCollection, transformer): Transformer is called with all elements that have been restangularized and match the specification regarding if it's a collection or not (true | false)
setTransformOnlyServerElements
This sets whether transformers will be run for local objects and not by objects returned by the server. This is by default true but can be changed to false if needed (Most people won't need this).
setOnElemRestangularized
This is a hook. After each element has been "restangularized" (Added the new methods from Restangular), this will be called. It means that if you receive a list of objects in one call, this method will be called first for the collection and then for each element of the collection.
I favor the usage of addElementTransformer
instead of onElemRestangularized
whenever possible as the implementation is much cleaner.
This callback is a function that has 4 parameters:
- elem: The element that has just been restangularized. Can be a collection or a single element.
- isCollection: Boolean indicating if this is a collection or a single element.
- what: The model that is being modified. This is the "path" of this resource. For example
buildings
- Restangular: The instanced service to use any of its methods
This can be used together with addRestangularMethod
(Explained later) to add custom methods to an element
service;
addResponseInterceptor
The responseInterceptor is called after we get each response from the server. It's a function that receives this arguments:
- data: The data received got from the server
- operation: The operation made. It'll be the HTTP method used except for a
GET
which returns a list of element which will returngetList
so that you can distinguish them. - what: The model that's being requested. It can be for example:
accounts
,buildings
, etc. - url: The relative URL being requested. For example:
/api/v1/accounts/123
- response: Full server response including headers
Some of the use cases of the responseInterceptor are handling wrapped responses and enhancing response elements with more methods among others.
The responseInterceptor must return the restangularized data element.
RestangularProvider; });
addFullRequestInterceptor
This adds a new fullRequestInterceptor. The fullRequestInterceptor is similar to the requestInterceptor
but more powerful. It lets you change the element, the request parameters and the headers as well.
It's a function that receives the same as the requestInterceptor
plus the headers and the query parameters (in that order).
It can return an object with any (or all) of following properties:
- headers: The headers to send
- params: The request parameters to send
- element: The element to send
RestangularProvider;
If a property isn't returned, the one sent is used.
addErrorInterceptor
The errorInterceptor is called whenever there's an error. It's a function that receives the response, subject and the Restangular-response handler as parameters.
The errorInterceptor function, whenever it returns false, prevents the observable linked to a Restangular request to be executed. All other return values (besides false) are ignored and the observable follows the usual path, eventually reaching the success or error hooks.
The refreshAccesstoken function must return observable. It`s function that will be done before repeating the request, there you can make some actions. In switchMap you might do some transformations to request.
// Function for settting the default restangular configuration { RestangularProvider; // This function must return observable var { // Here you can make action before repeated request return authService; }; RestangularProvider;} // AppModule is the main entry point into Angular2 bootstraping process@
setRestangularFields
Restangular required 3 fields for every "Restangularized" element. These are:
- id: Id of the element. Default: id
- route: Name of the route of this element. Default: route
- parentResource: The reference to the parent resource. Default: parentResource
- restangularCollection: A boolean indicating if this is a collection or an element. Default: restangularCollection
- cannonicalId: If available, the path to the cannonical ID to use. Useful for PK changes
- etag: Where to save the ETag received from the server. Defaults to
restangularEtag
- selfLink: The path to the property that has the URL to this item. If your REST API doesn't return a URL to an item, you can just leave it blank. Defaults to
href
Also all of Restangular methods and functions are configurable through restangularFields property.
All of these fields except for id
and selfLink
are handled by Restangular, so most of the time you won't change them. You can configure the name of the property that will be binded to all of this fields by setting restangularFields property.
setMethodOverriders
You can now Override HTTP Methods. You can set here the array of methods to override. All those methods will be sent as POST and Restangular will add an X-HTTP-Method-Override header with the real HTTP method we wanted to do.
RestangularProvider;
setDefaultRequestParams
You can set default Query parameters to be sent with every request and every method.
Additionally, if you want to configure request params per method, you can use requestParams
configuration similar to $http
. For example RestangularProvider.requestParams.get = {single: true}
.
Supported method to configure are: remove, get, post, put, common (all)
// set params for multiple methods at onceRestangularProvider; // set only for get methodRestangularProvider; // or for all supported request methodsRestangularProvider;
setFullResponse
You can set fullResponse to true to get the whole response every time you do any request. The full response has the restangularized data in the data
field, and also has the headers and config sent. By default, it's set to false. Please note that in order for Restangular to access custom HTTP headers, your server must respond having the Access-Control-Expose-Headers:
set.
// set params for multiple methods at onceRestangularProvider;
Or set it per service
// Restangular factory that uses setFullResponseconst REST_FUL_RESPONSE = 'RestFulResponse'; { return restangular;} // Configure factory in AppModule module// AppModule is the main entry point into Angular2 bootstraping process@ {} // Let's use it in the component@ users; { } { thisrestFulResponseall'users'; }
setDefaultHeaders
You can set default Headers to be sent with every request. Send format: {header_name: header_value}
;; // Function for settting the default restangular configuration { RestangularProvider;} // AppModule is the main entry point into Angular2 bootstraping process@
setRequestSuffix
If all of your requests require to send some suffix to work, you can set it here. For example, if you need to send the format like /users/123.json
you can add that .json
to the suffix using the setRequestSuffix
method
setUseCannonicalId
You can set this to either true
or false
. By default it's false. If set to true, then the cannonical ID from the element will be used for URL creation (in DELETE, PUT, POST, etc.). What this means is that if you change the ID of the element and then you do a put, if you set this to true, it'll use the "old" ID which was received from the server. If set to false, it'll use the new ID assigned to the element.
setPlainByDefault
You can set this to true
or false
. By default it's false. If set to true, data retrieved will be returned with no embed methods from restangular.
setEncodeIds
You can set here if you want to URL Encode IDs or not. By default, it's true.
Accessing configuration
You can also access the configuration via RestangularModule
and Restangular.provider
via the configuration
property if you don't want to use the setters. Check it out:
RestangularProviderconfigurationrequestSuffix = '/';
How to configure them globally
You can configure this in either the AppModule
.
AppModule
Configuring in the ; // Function for settting the default restangular configuration { RestangularProvider; RestangularProvider;} // AppModule is the main entry point into Angular2 bootstraping process@
AppModule
with Dependency Injection applied
Configuring in the ; // Function for settting the default restangular configuration { RestangularProvider; RestangularProvider; // Example of using Http service inside global config restangular RestangularProvider;} // AppModule is the main entry point into Angular2 bootstraping process@
How to create a Restangular service with a different configuration from the global one
Let's assume that for most requests you need some configuration (The global one), and for just a bunch of methods you need another configuration. In that case, you'll need to create another Restangular service with this particular configuration. This scoped configuration will inherit all defaults from the global one. Let's see how.
// Function for settting the default restangular configuration { RestangularProvider;} //Restangular service that uses Bingconst RESTANGULAR_BING = 'RestangularBing'; { return restangular;} // AppModule is the main entry point into Angular2 bootstraping process@ {} // Let's use it in the component@ {} { // GET to http://www.google.com/users // Uses global configuration Restangularall'users' // GET to http://www.bing.com/users // Uses Bing configuration which is based on Global one, therefore .json is added. RestangularBingall'users' };
Decoupled Restangular Service
There're some times where you want to use Restangular but you don't want to expose Restangular object anywhere. For those cases, you can actually use the service
feature of Restangular.
Let's see how it works:
// Restangular factory that uses Usersconst USER_REST = 'UserRest'; { return restangular;} // AppModule is the main entry point into Angular2 bootstraping process@ // Let's use it in the component { Users // GET to /users/2 Users // POST to /users // GET to /users Users }
We can also use Nested RESTful resources with this:
var Cars = Restangular; Cars // GET to /users/1/cars
Methods description
There are 3 sets of methods. Collections have some methods and elements have others. There are are also some common methods for all of them
Restangular methods
These are the methods that can be called on the Restangular object.
- one(route, id): This will create a new Restangular object that is just a pointer to one element with the route
route
and the specified id. - all(route): This will create a new Restangular object that is just a pointer to a list of elements for the specified path.
- oneUrl(route, url): This will create a new Restangular object that is just a pointer to one element with the specified URL.
- allUrl(route, url): This creates a Restangular object that is just a pointer to a list at the specified URL.
- copy(fromElement): This will create a copy of the from element so that we can modify the copied one.
- restangularizeElement(parent, element, route, queryParams): Restangularizes a new element
- restangularizeCollection(parent, element, route, queryParams): Restangularizes a new collection
Element methods
- get([queryParams, headers]): Gets the element. Query params and headers are optionals
- getList(subElement, [queryParams, headers]): Gets a nested resource. subElement is mandatory. It's a string with the name of the nested resource (and URL). For example
buildings
- put([queryParams, headers]): Does a put to the current element
- post(subElement, elementToPost, [queryParams, headers]): Does a POST and creates a subElement. Subelement is mandatory and is the nested resource. Element to post is the object to post to the server
- remove([queryParams, headers]): Does a DELETE. By default,
remove
sends a request with an empty object, which may cause problems with some servers or browsers. This shows how to configure RESTangular to have no payload. - head([queryParams, headers]): Does a HEAD
- trace([queryParams, headers]): Does a TRACE
- options([queryParams, headers]): Does a OPTIONS
- patch(object, [queryParams, headers]): Does a PATCH
- one(route, id): Used for RequestLess connections and URL Building. See section below.
- all(route): Used for RequestLess connections and URL Building. See section below.
- several(route, ids)*: Used for RequestLess connections and URL Building. See section below.
- oneUrl(route, url): This will create a new Restangular object that is just a pointer to one element with the specified URL.
- allUrl(route, url): This creates a Restangular object that is just a pointer to a list at the specified URL.
- getRestangularUrl(): Gets the URL of the current object.
- getRequestedUrl(): Gets the real URL the current object was requested with (incl. GET parameters). Will equal getRestangularUrl() when no parameters were used, before calling
get()
, or when using on a nested child. - getParentList(): Gets the parent list to which it belongs (if any)
- clone(): Copies the element. It's an alias to calling
Restangular.copy(elem)
. - plain(): Returns the plain element received from the server without any of the enhanced methods from Restangular. It's an alias to calling
Restangular.stripRestangular(elem)
- save: Calling save will determine whether to do PUT or POST accordingly
Collection methods
- getList([queryParams, headers]): Gets itself again (Remember this is a collection).
- get(id): Gets one item from the collection by id.
- post(elementToPost, [queryParams, headers]): Creates a new element of this collection.
- head([queryParams, headers]): Does a HEAD
- trace: ([queryParams, headers]): Does a TRACE
- options: ([queryParams, headers]): Does a OPTIONS
- patch(object, [queryParams, headers]): Does a PATCH
- remove([queryParams, headers]): Does a DELETE. By default,
remove
sends a request with an empty object, which may cause problems with some servers or browsers. This shows how to configure RESTangular to have no payload. - putElement(index, params, headers): Puts the element on the required index and returns a observable of the updated new array
Restangularall'users';
- getRestangularUrl(): Gets the URL of the current object.
- getRequestedUrl(): Gets the real URL the current object was requested with (incl. GET parameters). Will equal getRestangularUrl() when no parameters were used, before calling
getList()
, or when using on a nested child. - one(route, id): Used for RequestLess connections and URL Building. See section below.
- all(route): Used for RequestLess connections and URL Building. See section below.
- several(route, ids)*: Used for RequestLess connections and URL Building. See section below.
- oneUrl(route, url): This will create a new Restangular object that is just a pointer to one element with the specified URL.
- allUrl(route, url): This creates a Restangular object that is just a pointer to a list at the specified URL.
- clone(): Copies the collection. It's an alias to calling
Restangular.copy(collection)
.
Custom methods
- customGET(path, [params, headers]): Does a GET to the specific path. Optionally you can set params and headers.
- customGETLIST(path, [params, headers]): Does a GET to the specific path. In this case, you expect to get an array, not a single element. Optionally you can set params and headers.
- customDELETE(path, [params, headers]): Does a DELETE to the specific path. Optionally you can set params and headers.
- customPOST([elem, path, params, headers]): Does a POST to the specific path. Optionally you can set params and headers and elem. Elem is the element to post. If it's not set, it's assumed that it's the element itself from which you're calling this function.
- customPUT([elem, path, params, headers]): Does a PUT to the specific path. Optionally you can set params and headers and elem. Elem is the element to post. If it's not set, it's assumed that it's the element itself from which you're calling this function.
- customPATCH([elem, path, params, headers]): Does a PATCH to the specific path. Accepts the same arguments as customPUT.
- customOperation(operation, path, [params, headers, elem]): This does a custom operation to the path that we specify. This method is actually used from all the others in this subsection. Operation can be one of: get, post, put, remove, head, options, patch, trace
- addRestangularMethod(name, operation, [path, params, headers, elem]): This will add a new restangular method to this object with the name
name
to the operation and path specified (or current path otherwise). There's a section on how to do this later.
Let's see an example of this:
// GET /accounts/123/messagesRestangular // GET /accounts/messages?param=param2Restangularall"accounts"
Copying elements
Before modifying an object, we sometimes want to copy it and then modify the copied object. We can use Restangular.copy(fromElement)
.
Using values directly in templates with Observables
If you want to use values directly in templates use AsyncPipe
thisaccounts = thisrestangularall'accounts';
{{account.fullName}}
URL Building
Sometimes, we have a lot of nested entities (and their IDs), but we just want the last child. In those cases, doing a request for everything to get the last child is overkill. For those cases, I've added the possibility to create URLs using the same API as creating a new Restangular object. This connections are created without making any requests. Let's see how to do this:
var restangularSpaces = Restangularall"spaces"; // This will do ONE get to /accounts/123/buildings/456/spacesrestangularSpaces // This will do ONE get to /accounts/123/buildings/456/spaces/789Restangular // POST /accounts/123/buildings/456/spacesRestangularall"spaces"; // DELETE /accounts/123/buildings/456Restangular;
Creating new Restangular Methods
Let's assume that your API needs some custom methods to work. If that's the case, always calling customGET or customPOST for that method with all parameters is a pain in the ass. That's why every element has a addRestangularMethod
method.
This can be used together with the hook addElementTransformer
to do some neat stuff. Let's see an example to learn this:
// Function for settting the default restangular configuration { // It will transform all building elements, NOT collections RestangularProvider; RestangularProvider;} // AppModule is the main entry point into Angular2 bootstraping process@ // Then, later in your code you can do the following: // GET to /buildings/123/evaluate?myParam=param with headers myHeader: value // Signature for this "custom created" methods is (params, headers, elem) if it's a safe operation (GET, OPTIONS, etc.)// If it's an unsafe operation (POST, PUT, etc.), signature is (elem, params, headers). // If something is set to any of this variables, the default set in the method creation will be overridden// If nothing is set, then the defaults are sentRestangular; // GET to /buildings/123/evaluate?myParam=param with headers myHeader: specialHeaderCase Restangular; // Here the body of the POST is going to be {key: value} as POST is an unsafe operationRestangularall'users';
Adding Custom Methods to Collections
Create custom methods for your collection using Restangular.extendCollection(). This is an alias for:
RestangularProvider;
Example:
// create methods for your collection Restangular; var accounts$ = Restangularall'accounts'; accounts$;
Adding Custom Methods to Models
Create custom methods for your models using Restangular.extendModel(). This is an alias for:
RestangularProvider;
Example:
Restangular; var account$ = Restangular; account$;
FAQ
How can I handle errors?
Errors can be checked on the second argument of the subscribe.
Restangularall"accounts";
I need to send Authorization token in EVERY Restangular request, how can I do this?
You can use setDefaultHeaders
or addFullRequestInterceptor
;;;; // Function for settting the default restangular configuration { // set static header RestangularProvider; // by each request to the server receive a token and update headers with it RestangularProvider;} // AppModule is the main entry point into Angular2 bootstraping process@
I need to send one header in EVERY Restangular request, how can I do this?
You can use defaultHeaders
property for this. defaultsHeaders
can be scoped with withConfig
so it's really cool.
How can I send a delete WITHOUT a body?
You must add a requestInterceptor for this.
RestangularProvider
_id
not id
as the default. Therefore requests are sent to undefined routes
I use Mongo and the ID of the elements is What you need to do is to configure the RestangularFields
and set the id
field to _id
. Let's see how:
RestangularProvider;
What if each of my models has a different ID name like CustomerID for Customer
In some cases, people have different ID name for each entity. For example, they have CustomerID for customer and EquipmentID for Equipment. If that's the case, you can override Restangular's getIdFromElem. For that, you need to do:
RestangularProviderconfiguration { // if route is customers ==> returns customerID return elem_ + "ID";}
With that, you'd get what you need :)
How can I send files in my request using Restangular?
This can be done using the customPOST / customPUT method. Look at the following example:
Restangularall'users';
This basically tells the request to use the Content-Type: multipart/form-data as the header. Also formData is the body of the request, be sure to add all the params here, including the File you want to send of course.
How do I handle CRUD operations in a List returned by Restangular?
Restangularall'users';
Removing an element from a collection, keeping the collection restangularized
While the example above removes the deleted user from the collection, it also overwrites the collection object with a plain array (because of _.without
) which no longer knows about its Restangular attributes.
If want to keep the restangularized collection, remove the element by modifying the collection in place:
userWithId;
unrestangularized
element as well as the restangularized
one?
How can I access the In order to get this done, you need to use the responseExtractor
. You need to set a property there that will point to the original response received. Also, you need to actually copy this response as that response is the one that's going to be restangularized
later
RestangularProvider;
Alternatively, if you just want the stripped out response on any given call, you can use the .plain() method, doing something like this:
this { baseUrl;};
How can add withCredentials params to requests?
// Function for settting the default restangular configuration { // Adding withCredential parametr to all Restangular requests RestangularProvider;} @ {}
Server Frameworks
Users reported that this server frameworks play real nice with Ng2-Restangular, as they let you create a Nested RESTful Resources API easily:
- Ruby on Rails
- CakePHP, Laravel and FatFREE, Symfony2 with RestBundle, Silex for PHP
- Play1 & 2 for Java & scala
- Dropwizard for Java
- Restify and Express for NodeJS
- Tastypie and Django Rest Framework for Django
- Slim Framework
- Symfony2 with FOSRestBundle (PHP)
- Microsoft ASP.NET Web API 2
- Grails Framework (example)
License
The MIT License