Tornado 6.5 Documentationfetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") 26 Chapter 6. DocumentationTornado setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False per-handler basis, you can override RequestHandler. check_xsrf_cookie(). For example, if you have an API whose authentication does not use cookies, you may want to disable XSRF protection by making check_xsrf_cookie()0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 4.5 Documentation
— Bridges between Twisted and Tornado Utilities tornado.autoreload — Automatically detect code changes in development tornado.log — Logging support tornado.options — Command-line parsing tornado.stack_context else the user’s browser will simply hang. Here is an example that makes a call to the FriendFeed API using Tornado’s built-in AsyncHTTPClient: class MainHandler(tornado.web.RequestHandler): @tornado get(self): http = tornado.httpclient.AsyncHTTPClient() http.fetch("http://friendfeed-api.com/v2/feed/bret", callback=self.on_response) def on_response(self, response):0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 6.1 Documentation
fetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") For a more advanced setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False per-handler basis, you can override RequestHandler. check_xsrf_cookie(). For example, if you have an API whose authentication does not use cookies, you may want to disable XSRF protection by making check_xsrf_cookie()0 码力 | 245 页 | 904.24 KB | 1 年前3
Tornado 6.4 Documentation
fetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") 26 Chapter 6. Documentation setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False per-handler basis, you can override RequestHandler. check_xsrf_cookie(). For example, if you have an API whose authentication does not use cookies, you may want to disable XSRF protection by making check_xsrf_cookie()0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
fetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") 26 Chapter 6. Documentation setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False per-handler basis, you can override RequestHandler. check_xsrf_cookie(). For example, if you have an API whose authentication does not use cookies, you may want to disable XSRF protection by making check_xsrf_cookie()0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
fetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") 26 Chapter 6. Documentation setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False per-handler basis, you can override RequestHandler. check_xsrf_cookie(). For example, if you have an API whose authentication does not use cookies, you may want to disable XSRF protection by making check_xsrf_cookie()0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 4.5 Documentation
else the user’s browser will simply hang. Here is an example that makes a call to the FriendFeed API using Tornado’s built-in AsyncHTTPClient: class MainHandler(tornado.web.RequestHandler): @tornado asynchronous def get(self): http = tornado.httpclient.AsyncHTTPClient() http.fetch("http://friendfeed-api.com/v2/feed/bret", callback=self.on_response) def on_response(self, response): if response.error: json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") self.finish() When get() returns, the request has not finished. When the HTTP client eventually0 码力 | 222 页 | 833.04 KB | 1 年前3
Tornado 5.1 Documentation
fetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") For a more advanced setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False per-handler basis, you can override RequestHandler. check_xsrf_cookie(). For example, if you have an API whose authentication does not use cookies, you may want to disable XSRF protection by making check_xsrf_cookie()0 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 6.2 Documentation
get(self): http = tornado.httpclient.AsyncHTTPClient() response = await http.fetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) (continues on next page) 26 Chapter previous page) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") For a more advanced asynchronous example, take a look at the chat example application, which implements setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False0 码力 | 260 页 | 1.06 MB | 1 年前3
Tornado 6.3 Documentation
fetch("http://friendfeed-api.com/v2/feed/bret") json = tornado.escape.json_decode(response.body) self.write("Fetched " + str(len(json["entries"])) + " entries " "from the FriendFeed API") 26 Chapter 6. Documentation setting. Compiled templates are cached by default; to turn off this caching and reload templates so changes to the underlying files are always visible, use the application settings compiled_template_cache=False per-handler basis, you can override RequestHandler. check_xsrf_cookie(). For example, if you have an API whose authentication does not use cookies, you may want to disable XSRF protection by making check_xsrf_cookie()0 码力 | 264 页 | 1.06 MB | 1 年前3
共 20 条
- 1
- 2













