如何在Python中使用套接字发送cgi.FieldStorage对象

时间:2019-06-18 06:05:02

标签: python sockets cgi

我正在尝试发送使用CGI的FieldStorage函数创建的对象。以下代码给出了以下错误。

cgitb.enable()
form = cgi.FieldStorage()
...# There are some another blocks that creates clientsock as our socket
clientsock.sendall(form)

这是它返回的错误。

TypeError: a bytes-like object is required, not 'FieldStorage'

您认为我做错了什么?重新发送来自HTTP客户端的程序包的最佳方法是什么?

0 个答案:

没有答案