我試圖動態生成使用Max M的icalendar python模塊和谷歌的應用引擎iCal輸出。但是,當我從webapp.RequestHandler
的輸出中省略了<html>
鍋爐板上的頁眉和頁腳標記時,它看起來像HTTP 200響應被添加到文件的頂部。從谷歌的應用引擎生成非HTML輸出
當我註冊驗證碼:
class Calendar(webapp.RequestHandler):
def get(self):
self.response.out.write('BEGIN:VCALENDAR\n')
[...]
與webapp.WSGIApplication
,響應的樣子:
Status: 200 OK
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Content-Length: 11133
BEGIN:VCALENDAR
[...]
如何省略<html>
標籤和沒有得到HTTP 200響應splatted在頁面的頂部?
嗯,它看起來像我需要看看http://docs.djangoproject.com/en/dev/ref/request-response/#telling-the-browser-to-treat-the-response-as- a-file-attachment – 2011-02-23 22:03:21