leon 3 주 전
부모
커밋
b24bece68c
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      test.py

+ 2 - 2
test.py

@@ -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: