我有使用soaplib构建的soap webservice,
但是如果客户端发送了chunked请求,它就会失败
length = req_env.get("CONTENT_LENGTH")
body = input.read(int(length))
因为长度是''(空字符串),任何想法如何修复soaplib?
答案 0 :(得分:0)
if '' != length: body = input.read(int(length)) elif req_env.get("HTTP_TRANSFER_ENCODING").lower() == 'chunked': chunk_size = int(input.readline(), 16) while chunk_size > 0: chunk_read_size = 0 tmp = input.read(chunk_size) chunk_read_size += len(tmp) body += tmp while chunk_read_size