You can use the RPC package to automate the data serialization and request routing for your REST API. Exposing a REST API is simple. Annotate your classes and methods with the HTTP methods, URL paths, etc. Here is an example of a simple echo service.
After you configure your HTTP server (see README), your API can now be reached at:
GET http://<server url>:<port>/api/echo/v1/identity/<name>
POST http://<server url>:<port>/api/echo/v1/inverse
Calling your new server API from client code (written in Dart, Java, Go, iOS, Android, C#) is also easy. For more details on the specifics, check out the README. You can also find a simple Getting Started example that shows how to hook it all up using either dart:io or shelf.
We currently use the RPC package for Dart Pad and TodoMVC, and we hope you'll find this package as helpful as we do. We look forward to your feedback.
Written by Gustav Wibling, Rapid Productivity Champion