Commit Graph

78 Commits

Author SHA1 Message Date
r0fls
5b051f0891 add test 2018-01-01 02:14:55 -08:00
Raphael Deem
bb8e9c6438 check if method is added in strict slash logic 2017-11-03 18:36:06 -07:00
Yun Xu
770a8fb288 raise exception for invalid param syntax 2017-10-09 07:54:39 -07:00
Yun Xu
5d23c7644b add unit tests 2017-08-20 23:37:22 -07:00
Miguel Grinberg
375ed23216
Weboscket subprotocol negotiation
Fixes #874
2017-08-08 11:40:44 -07:00
Raphael Deem
4265ad5f23 add versioning 2017-07-12 22:19:42 -07:00
38elements
6a14e49479 Replace stream decorator to stream parameter 2017-05-09 22:31:15 +09:00
38elements
4d4f38fb35 is_request_stream for CompositionView and HTTPMethodView 2017-05-09 01:04:03 +09:00
messense
35b92e1511
Add path type for router 2017-04-13 11:34:35 +08:00
Raphael Deem
46677e69ce accept strict_slash routes 2017-03-16 11:46:07 -07:00
Eli Uriegas
8e6678d526 Merge pull request #469 from miguelgrinberg/websocket-support
websocket support
2017-03-05 17:42:49 -08:00
Miguel Grinberg
3bf79898d9 websocket unit test 2017-02-27 22:35:28 -08:00
Raphael Deem
21fb1dff7e fix routing issue with slashes 2017-02-27 20:01:11 -08:00
Raphael Deem
207ec1e032 route logic for trailing slash 2017-02-20 16:11:28 -08:00
Suby Raman
3b68dc72e7 rework testing 2017-02-14 14:51:20 -05:00
Eli Uriegas
7780a8c187 Merge pull request #320 from r0fls/method-decorators
add method shorthands
2017-01-20 14:38:34 -06:00
Raphael Deem
6fd69b6284 separate tests 2017-01-20 10:19:14 -08:00
Raphael Deem
96424b6b0a add method shorthands 2017-01-20 00:07:22 -08:00
Jeong YunWon
0a160c4a0b For function decorators, ['GET'] is the default methods 2017-01-19 23:56:51 +09:00
Jeong YunWon
11f3c79a77 Feature: Routing overload
When user specifies HTTP methods to function handlers, it automatically
will be overloaded unless they duplicate.

Example:

    # This is a new route. It works as before.
    @app.route('/overload', methods=['GET'])
    async def handler1(request):
        return text('OK1')

    # This is the exiting route but a new method. They are merged and
    # work as combined. The route will serve all of GET, POST and PUT.
    @app.route('/overload', methods=['POST', 'PUT'])
    async def handler2(request):
        return text('OK2')

    # This is the existing route and PUT method is the duplicated method.
    # It raises RouteExists.
    @app.route('/overload', methods=['PUT', 'DELETE'])
    async def handler3(request):
	return text('Duplicated')
2017-01-19 07:12:45 +09:00
Diogo
0f6ed642da created methods to remove a route from api/router 2016-12-30 07:36:57 -02:00
Anton Zhyrney
9f2d73e2f1 class based views implementation for sanic 2016-11-25 09:10:25 +02:00
chhsiao90
9051e985a0 Add test for method not allow situation 2016-10-23 21:58:57 +08:00
Channel Cat
d4e2d94816 Added support for routes with / in custom regexes and updated lru to use url and method 2016-10-20 11:33:28 +00:00
Giorgio Salluzzo
3e8b8fb46f Fix for issue #44. 2016-10-16 22:41:56 +02:00
Channel Cat
254861bc37 Reformatted code to use spaces instead of tabs 2016-10-14 19:53:49 -07:00
Eli Uriegas
7a313fc268 Fix link to helper 2016-10-14 17:38:43 -05:00
Channel Cat
a74ab9bd18 Added tests and middleware, and improved documentation 2016-10-14 03:23:48 -07:00