Replace stream decorator to stream parameter
This commit is contained in:
		
							
								
								
									
										19
									
								
								sanic/app.py
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								sanic/app.py
									
									
									
									
									
								
							| @@ -144,13 +144,13 @@ class Sanic: | ||||
|         return self.route(uri, methods=frozenset({"GET"}), host=host, | ||||
|                           strict_slashes=strict_slashes) | ||||
|  | ||||
|     def post(self, uri, host=None, strict_slashes=False): | ||||
|     def post(self, uri, host=None, strict_slashes=False, stream=False): | ||||
|         return self.route(uri, methods=frozenset({"POST"}), host=host, | ||||
|                           strict_slashes=strict_slashes) | ||||
|                           strict_slashes=strict_slashes, stream=stream) | ||||
|  | ||||
|     def put(self, uri, host=None, strict_slashes=False): | ||||
|     def put(self, uri, host=None, strict_slashes=False, stream=False): | ||||
|         return self.route(uri, methods=frozenset({"PUT"}), host=host, | ||||
|                           strict_slashes=strict_slashes) | ||||
|                           strict_slashes=strict_slashes, stream=stream) | ||||
|  | ||||
|     def head(self, uri, host=None, strict_slashes=False): | ||||
|         return self.route(uri, methods=frozenset({"HEAD"}), host=host, | ||||
| @@ -160,21 +160,14 @@ class Sanic: | ||||
|         return self.route(uri, methods=frozenset({"OPTIONS"}), host=host, | ||||
|                           strict_slashes=strict_slashes) | ||||
|  | ||||
|     def patch(self, uri, host=None, strict_slashes=False): | ||||
|     def patch(self, uri, host=None, strict_slashes=False, stream=False): | ||||
|         return self.route(uri, methods=frozenset({"PATCH"}), host=host, | ||||
|                           strict_slashes=strict_slashes) | ||||
|                           strict_slashes=strict_slashes, stream=stream) | ||||
|  | ||||
|     def delete(self, uri, host=None, strict_slashes=False): | ||||
|         return self.route(uri, methods=frozenset({"DELETE"}), host=host, | ||||
|                           strict_slashes=strict_slashes) | ||||
|  | ||||
|     def stream( | ||||
|             self, uri, methods=frozenset({"POST"}), host=None, | ||||
|             strict_slashes=False): | ||||
|         return self.route(uri, methods=methods, host=host, | ||||
|                           strict_slashes=strict_slashes, | ||||
|                           stream=True) | ||||
|  | ||||
|     def add_route(self, handler, uri, methods=frozenset({'GET'}), host=None, | ||||
|                   strict_slashes=False): | ||||
|         """A helper method to register class instance or | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 38elements
					38elements