rest 0.2.3
rest: ^0.2.3 copied to clipboard
This is a helper for creating RESTful applications. It also comes equipped with an implementation for HTTP REST.
rest #
A Dart library for creating REST applications.
Example #
import 'rest:rest/http_rest.dart' show HttpRest, HttpRestRoute;
var routes = {
r"^foo": {
r"^bar$": {
r"\d+": new HttpRestRoute({
'GET': getFooBar // a function called createFooBar
}),
}),
}
};
// create the rest object itself
HttpRest rest = new HttpRest(routes);
HttpServer.bind('0.0.0.0', 8000),then((server) {
server.listen((HttpRequest request)
rest.resolve(request);
});
});
getFooBar() {
return new HttpRestResponse().build(204, 'created a fooBar!\n');
}
Documentation #
See doc/rest.md
.
API docs are generated and available on pub.flutter-io.cn.
http://pub.flutter-io.cn/packages/rest
Copyright/Licensing #
See LICENSE