diff --git a/README.md b/README.md index 976930c..d57bf78 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,13 @@ Only **Python 3.6+** is supported. The primary concept here is to bring the niceties that are brought forth from both Flask and Falcon and unify them into a single framework, along with some new ideas I have. I also wanted to take some of the API primitives that are instilled in the Requests library and put them into a web framework. So, you'll find a lot of parallels here with Requests. -- Setting `resp.text` sends back unicode, while setting `resp.content` sends back bytes. -- Setting `resp.media` sends back JSON/YAML (`.text`/`.content` override this). +- Setting `resp.content` sends back bytes. +- Setting `resp.text` sends back unicode, while setting `resp.html` sends back HTML. +- Setting `resp.media` sends back JSON/YAML (`.text`/`.html`/`.content` override this). - Case-insensitive `req.headers` dict (from Requests directly). - `resp.status_code`, `req.method`, `req.url`, and other familiar friends. + ## Ideas - Flask-style route expression, with new capabilities -- all while using Python 3.6+'s new f-string syntax. diff --git a/docs/source/index.rst b/docs/source/index.rst index 3a8e2fb..dbd4e85 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -113,8 +113,9 @@ The Basic Idea The primary concept here is to bring the niceties that are brought forth from both Flask and Falcon and unify them into a single framework, along with some new ideas I have. I also wanted to take some of the API primitives that are instilled in the Requests library and put them into a web framework. So, you'll find a lot of parallels here with Requests. -- Setting ``resp.text`` sends back unicode, while setting ``resp.content`` sends back bytes. -- Setting ``resp.media`` sends back JSON/YAML (``.text``/``.content`` override this). +- Setting ``resp.content`` sends back bytes. +- Setting ``resp.text`` sends back unicode, while setting ``resp.html`` sends back HTML. +- Setting ``resp.media`` sends back JSON/YAML (``.text``/``.html``/``.content`` override this). - Case-insensitive ``req.headers`` dict (from Requests directly). - ``resp.status_code``, ``req.method``, ``req.url``, and other familiar friends. diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index f1be68d..dfec257 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -69,7 +69,7 @@ If you want to render a template, simply use ``api.template``. No need for addit @api.route("/hello/{who}/html") def hello_html(req, resp, *, who): - resp.content = api.template('hello.html', who=who) + resp.html = api.template('hello.html', who=who) The ``api`` instance is available as an object during template rendering.