All will respond with an HTTP status code of "200 OK". Works on .32:
def GET(self):
return 'implicit 200'def GET(self):
web.ctx.status = '200 OK' return 'explicit 200'
def GET(self): raise web.OK('explicit 200')
You shouldn't be receiving an AttributeError when calling OK if you've simply imported web.py standalone (`import web`).
If you are having a problem sending raw HTML you might find that you need to send an explicit HTTP Content-Type header using:
web.header('Content-Type', 'text/html')or optionally define a character set:
web.header('Content-Type', 'text/html; charset=utf-8')When rendering a template using a `web.template.render` object the header is automagically sent using the appropriate MIME (content) type based on the file being rendered (.html => text/html; charset=utf-8, .xhtml => application/xhtml+xml; charset=utf-8, .txt => text/plain — see line 820 in `template.py`).
Let me know if that helps.
--
Angelo Gladding
ang...@gladding.namehttp://angelo.gladding.name/
E69E 47E8 5C3A 96E5 C70F
D931 F35C ACBA 6F39 9611