XML UploadResult OriginalInfo Keytest.jpeg/Key Locationqr-code-1305143506.cos.ap-shanghai.myqcloud.com/test.jpeg/Location ETag"930b8ceb82c9e7ed3dc61bdc0f8577065f7484a7"/ETag ImageInfo FormatJPEG/Format Width1664/Width Height2338/Height Qual
XML
<UploadResult><OriginalInfo>
<Key>test.jpeg</Key>
<Location>qr-code-1305143506.cos.ap-shanghai.myqcloud.com/test.jpeg</Location>
<ETag>"930b8ceb82c9e7ed3dc61bdc0f8577065f7484a7"</ETag>
<ImageInfo>
<Format>JPEG</Format>
<Width>1664</Width>
<Height>2338</Height>
<Quality>93</Quality>
<Ave>0xe0e0e0</Ave>
<Orientation>0</Orientation>
</ImageInfo>
</OriginalInfo>
<ProcessResults>
<Object>
<Format>JPEG</Format>
<Width>1664</Width>
<Height>2338</Height>
<Size>234344</Size>
<Quality>93</Quality>
<CodeStatus>1</CodeStatus>
<QRcodeInfo>
<CodeUrl>王懿馨:101005:[object MouseEvent]</CodeUrl>
<CodeLocation>
<Point>1430,396</Point>
<Point>1432,241</Point>
<Point>1586,242</Point>
<Point>1587,397</Point>
</CodeLocation>
</QRcodeInfo>
</Object>
</ProcessResults>
</UploadResult>import io
from rest_framework_xml.parsers import XMLParser
# response.text ==> xml
s = io.StringIO(response.text)
parser_data = XMLParser().parse(s)
解析后数据
{'OriginalInfo': {
'Key': 'test.jpeg',
'Location': 'qr-code-1305143506.cos.ap-shanghai.myqcloud.com/test.jpeg',
'ETag': '"930b8ceb82c9e7ed3dc61bdc0f8577065f7484a7"',
'ImageInfo': {
'Format': 'JPEG',
'Width': 1664,
'Height': 2338,
'Quality': 93,
'Ave': '0xe0e0e0',
'Orientation': 0
}
},
'ProcessResults': {
'Object': {
'Format': 'JPEG',
'Width': 1664,
'Height': 2338,
'Size': 234344,
'Quality': 93,
'CodeStatus': 1,
'QRcodeInfo': {
'CodeUrl': '王懿馨:101005:[object MouseEvent]',
'CodeLocation': {
'Point': '1587,397'
}
}
}
}
}