diff --git a/tinyweb/server.py b/tinyweb/server.py index 177dd58..8efcad7 100644 --- a/tinyweb/server.py +++ b/tinyweb/server.py @@ -608,6 +608,14 @@ def _route(f): self.add_route(url, f, **kwargs) return f return _route + + def get(self, url, **kwargs): + kwargs['methods'] = ['GET'] + return self.route(url, **kwargs) + + def post(self, url, **kwargs): + kwargs['methods'] = ['POST'] + return self.route(url, **kwargs) def resource(self, url, method='GET', **kwargs): """Decorator for add_resource() method