AppData\Local\Programs\Python\Python36-32\lib\urllib\request.py", line 1248, in do_request_TypeError: POST data should be bytes, an iterable of bytes, or a file object.从betfair得到了一个api,但它仍然不能工作。
检查我做了什么(请求在‘data’中是相同的):import urllib.request
"jsonrpc":"2.0(msg)
TypeError: POST data should be bytes, an iterable of bytes, or a file object.因此,我对此进行了询问,并了解到必须使用函数urllib.parse.urlencode()将请求转换为字节,因