我正在尝试使用带有python的reportlab生成pdf。现在,每当我调用函数从get(self)函数生成pdf时它都可以正常工作,但是当从post(self)调用函数时,同样的事情不起作用。在日志中测试,生成pdf的功能在两种情况下都运行良好。问题似乎在pdf输出中(get和post)。我试过保持内容处置作为附件和内联但无济于事。
以下是generatePdf:
的代码部分class PDFHandler(BlogHandler):
def get(self):
self.render("create_offer_letter.html")
candidate_name = "Siddhant"
candidate_email ="ssjjs@ksks.com"
candidate_phone = "939393993"
address_part = ['sjsjjs','ksksksks']
confirmation_date = "22/07/2013"
coursefee = "282828"
admissionfee = "8388383"
institute ="NIMT"
course ="MBA"
feeterm ="Trimester"
#generatePdf(self,candidate_name,candidate_email,candidate_phone,address_part,confirmation_date,coursefee,admissionfee,institute,course, feeterm)
def post(self):
self.render("create_offer_letter.html")
candidate_name = "Siddhant"
candidate_email ="ssjjs@ksks.com"
candidate_phone = "939393993"
address_part = ['sjsjjs','ksksksks']
confirmation_date = "22/07/2013"
coursefee = "282828"
admissionfee = "8388383"
institute ="NIMT"
course ="MBA"
feeterm ="Trimester"
generatePdf(self,candidate_name,candidate_email,candidate_phone,address_part,confirmation_date,coursefee,admissionfee,institute,course, feeterm)
我想它必须用http标题做些什么?我不确定。