2
我试图通过GET请求在猎鹰中发送CSV。我不知道从哪里开始。通过Falcon在身体中发送CSV
下面是我的代码:
class LogCSV(object):
"""CSV generator.
This class responds to GET methods.
"""
def on_get(self, req, resp):
"""Generates CSV for log."""
mylist = [
'one','two','three'
]
myfile = open("testlogcsv.csv", 'w')
wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
wr.writerow(mylist)
resp.status = falcon.HTTP_200
resp.content_type = 'text/csv'
resp.body = wr
我不想spoonfeeding,请让我知道我应该读/表来帮助解决这个问题是什么。 谢谢