Hello Pengyu, A Response() object by itself does not have any information about the HTTP protocol used to create the request. It is simply an object that implements the WSGI required handlers, which provides the information you see below:
1. Status Code 2. headers 3. body if applicable The request environment will have information about the protocol if using a compliant HTTP -> WSGI gateway implementation. The Response() objects __str__ implementation does not access the request environment, and thus can not provide the HTTP protocol used. Is there a particular reason you’d like it to be included in the str output? Bert > On Jul 22, 2017, at 17:15, [email protected] wrote: > > The following example does not have the protocol info, e.g. 'HTTP/1.0'. Is > there a way to add such info? > > $ cat main.py > #!/usr/bin/env python > # vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 > fileencoding=utf-8: > > from webob import Response > res = Response() > print str(res) > > $ ./main.py > 200 OK > Content-Type: text/html; charset=UTF-8 > Content-Length: 0 > > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pylons-discuss/12b55319-4de8-493e-8484-c4d9e38ad9fd%40googlegroups.com > > <https://groups.google.com/d/msgid/pylons-discuss/12b55319-4de8-493e-8484-c4d9e38ad9fd%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/A70D6420-66DB-4C44-A862-F8E8516CB6C2%400x58.com. For more options, visit https://groups.google.com/d/optout.
