|
@@ -15,8 +15,8 @@ async def upload_image(session, url, payload, files):
|
|
|
form_data.add_field(key, value)
|
|
|
|
|
|
# 添加文件数据
|
|
|
- for filename, content, content_type in files:
|
|
|
- form_data.add_field('file', content, filename=filename, content_type=content_type)
|
|
|
+ for key, (filename, content, content_type) in files:
|
|
|
+ form_data.add_field(key, content, filename=filename, content_type=content_type)
|
|
|
|
|
|
# 发起 POST 请求
|
|
|
async with session.post(url, data=form_data) as response:
|