1234567891011121314151617 |
- *** Keywords ***
- PutRequestFile
- [Arguments] ${host} ${path} ${filepath} ${Authorization} ${FileType} ${FileToken}
- ${header_dict} Create Dictionary Content-Type=multipart/form-data
- Set To Dictionary ${header_dict} Authorization=${Authorization}
- Set To Dictionary ${header_dict} FileInfo=FileType=${FileType}&FileToken=${FileToken}
- #文件上传测试-POST
- Create Session file_upload ${host} verify=True
- # 打开文件
- ${file_data} Get File For Streaming Upload ${filepath}
- # 文件参数
- ${file_parts} Create Dictionary
- Set To Dictionary ${file_parts} file=${file_data}
- # 文件上传参数
- ${resp} Put On Session file_upload ${path} files=${file_parts} headers=${header_dict}
- Log ${resp}
- [Return] ${resp}
|