Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Response.content_type defaults to text/html (#1181) #1295

Merged
merged 1 commit into from
Apr 15, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docs/narr/webob.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ Here are some highlights:
The content type *not* including the ``charset`` parameter.
Typical use: ``response.content_type = 'text/html'``.

Default value: ``response.content_type = 'text/html'``.

``response.charset``:
The ``charset`` parameter of the content-type, it also informs
encoding in ``response.unicode_body``.
Expand Down Expand Up @@ -466,9 +468,12 @@ argument to the class; e.g.:
from pyramid.response import Response
response = Response(body='hello world!', content_type='text/plain')

The status defaults to ``'200 OK'``. The content_type does not default to
anything, though if you subclass :class:`pyramid.response.Response` and set
``default_content_type`` you can override this behavior.
The status defaults to ``'200 OK'``.

The value of content_type defaults to
``webob.response.Response.default_content_type``; which is `text/html`.
You can subclass :class:`pyramid.response.Response` and set
``default_content_type`` to override this behavior.

.. index::
single: exception responses
Expand Down