我正在尝试发送使用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客户端的程序包的最佳方法是什么?