1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| oss_forms_res = requests.post('https://shimo.im/api/upload/oss_forms', { 'head': 1, 'guid': guid }, headers=headers).json(object_pairs_hook=OrderedDict)
policy = b64encode(dumps( oss_forms_res['data']['policy'], separators=(',', ':') ).encode()).decode()
oss_res = requests.post(oss_base_url, headers=headers, files=( ('OSSAccessKeyId', (None, oss_forms_res['data']['OSSAccessKeyId'], None)), ('policy', (None, policy, None)), ('Signature', (None, oss_forms_res['data']['signature'], None)), ('key', (None, uri, None)), ('Content-Type', (None, 'multipart/form-data', None)), ('file', ('blob', b'qq', 'application/zip')), ))
|