Falcon v0.2.0 Documentation
Python ecosytem offers a bunch of great libraries that you are welcome to use from within your responder, hooks, and middleware. Falcon doesn’t try to dictate what you should use, since that would take also this section of the tutorial. How can I pass data from a hook to a responder, and between hooks? You can inject extra responder kwargs from a hook by adding them to the params dict passed into the hook for the most part, do the right thing. In other words, Falcon doesn’t try very hard to protect responder code from itself. This approach reduces the number of (often) extraneous checks that Falcon would0 码力 | 188 页 | 358.44 KB | 1 年前3Falcon v1.0.0 Documentation
also this section of the tutorial. How can I pass data from a hook to a responder, and between hooks? You can inject extra responder kwargs from a hook by adding them to the params dict passed into the hook for the most part, do the right thing. In other words, Falcon doesn’t try very hard to protect responder code from itself. This approach reduces the number of (often) extraneous checks that Falcon would high code coverage. 3. Errors are anticipated, detected, and handled appropriately within each responder and with the aid of custom error handlers. Tip Falcon will re-raise errors that do not inherit0 码力 | 249 页 | 406.22 KB | 1 年前3Falcon v1.0.0 Documentation
also this section of the tutorial. How can I pass data from a hook to a responder, and between hooks? You can inject extra responder kwargs from a hook by adding them to the params dict passed into the hook for the most part, do the right thing. In other words, Falcon doesn’t try very hard to protect responder code from itself. This approach reduces the number of (often) extraneous checks that Falcon would high code coverage. 3. Errors are anticipated, detected, and handled appropriately within each responder and with the aid of custom error handlers. Tip Falcon will re-raise errors that do not inherit0 码力 | 312 页 | 368.58 KB | 1 年前3Falcon v3.0.0 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError RequireJSON.process_request → JSONTranslator.process_request ├── Process route responder ↢ JSONTranslator.process_response • Sinks: ⇥ /search/(?Pddg|y)\Z SinkAdapter StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 1055 页 | 739.30 KB | 1 年前3Falcon v3.0.1 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError RequireJSON.process_request → JSONTranslator.process_request ├── Process route responder ↢ JSONTranslator.process_response • Sinks: ⇥ /search/(?Pddg|y)\Z SinkAdapter StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 1058 页 | 741.59 KB | 1 年前3Falcon v3.0.0-b2 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError RequireJSON.process_request → JSONTranslator.process_request ├── Process route responder ↢ JSONTranslator.process_response • Sinks: ⇥ /search/(?Pddg|y)\Z SinkAdapter StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 1041 页 | 730.21 KB | 1 年前3Falcon v3.0.0-b1 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError RequireJSON.process_request → JSONTranslator.process_request ├── Process route responder ↢ JSONTranslator.process_response • Sinks: ⇥ /search/(?Pddg|y)\Z SinkAdapter StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 1028 页 | 725.86 KB | 1 年前3Falcon v1.2.0 Documentation
also this section of the tutorial. How can I pass data from a hook to a responder, and between hooks? You can inject extra responder kwargs from a hook by adding them to the params dict passed into the hook for the most part, do the right thing. In other words, Falcon doesn’t try very hard to protect responder code from itself. This approach reduces the number of (often) extraneous checks that Falcon would high code coverage. 3. Errors are anticipated, detected, and handled appropriately within each responder and with the aid of custom error handlers. Tip Falcon will re-raise errors that do not inherit0 码力 | 177 页 | 252.56 KB | 1 年前3Falcon v1.3.0 Documentation
implement both POSTing and GETing items for the same resource? How can I pass data from a hook to a responder, and between hooks? Does Falcon set Content-Length or do I need to do that explicitly? I’m setting StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raised an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError g., on_get(), on_put(), on_head(), etc.). We call these well-known methods “responders”. Each responder takes (at least) two params, one representing the HTTP request, and one representing the HTTP response0 码力 | 194 页 | 266.90 KB | 1 年前3Falcon v3.1.1 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError RequireJSON.process_request → JSONTranslator.process_request ├── Process route responder ↢ JSONTranslator.process_response • Sinks: ⇥ /search/(?Pddg|y)\Z SinkAdapter StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 540 页 | 476.60 KB | 1 年前3
共 33 条
- 1
- 2
- 3
- 4