Python:如何从BaseHTTPRequestHandler HTTP POST处理程序获取键值对?

Python:如何从BaseHTTPRequestHandler HTTP POST处理程序获取键值对?,第1张

Python:如何从BaseHTTPRequestHandler HTTP POST处理程序获取键/值对?
def do_POST(self):    ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))    if ctype == 'multipart/form-data':        postvars = cgi.parse_multipart(self.rfile, pdict)    elif ctype == 'application/x-www-form-urlenpred':        length = int(self.headers.getheader('content-length'))        postvars = cgi.parse_qs(self.rfile.read(length), keep_blank_values=1)    else:        postvars = {}    ...


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5652802.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存