[问题] 解码Base64字串并转成byte array

楼主: dwadefans (wade)   2016-06-19 13:48:05
我的client端为Android平台撰写语言为Java
在Java端将byte array ( byte[] ) 编码成base64字串
送至Python 的 Server端接收到base64字串
但是要将此字串解码为python的byte array遇到了一些问题
des_encoded = request.args["des_encoded"]
data = base64.b64decode(des_encoded)
错误讯息:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line
1439, in dataReceived
finishCallback(data[contentLength:])
File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line
1708, in _finishRequestBody
self.allContentReceived()
File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line
1781, in allContentReceived
req.requestReceived(command, path, version)
File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line
768, in requestReceived
self.process()
作者: alibuda174 (阿哩不达)   2016-06-19 14:21:00
错误讯息不是说了,你应丢进去string或buffer但你却丢进去list
楼主: dwadefans (wade)   2016-06-20 13:34:00
我的type真的是list... 好奇怪 原来如此 我在检查谢谢

Links booklink

Contact Us: admin [ a t ] ucptt.com