我正在尝试在ROBOT框架中传递以下API请求:
curl --request POST --url <API End Point> --form 'mldata={"id": “idname”, "author": “author name, "title": “title name, "description": “description details“, "version": "0.0.4", "image": “/path/to/image”, "icon": "base64 encoded image"};type=application/json' --header "Authorization: <Bearer Token>”
在ROBOT框架[版本:3.2.2]中写了相同的文字,但文字越来越error: "status=400, reason=Bad Request body={"message":"Request is not a multipart request!"}"
浓
看来我没有以正确的方式传递--form数据。在传递表单数据时请求帮助[ --form'mldata = {“ id”:“ idname”,“ author”:“作者名称,” title“:”标题名称,“ description”:“描述详细信息”,“版本”:“ 0.0.4”,“图像”:“ / path / to / image”,“ icon”:“ base64编码图像”}; type = application / json' ]在机器人框架中。
我应该如何以正确的方式通过?
Onboard ML From External Repo
[Arguments] ${token}=default
Create Session session ${host}
${data}= Create Dictionary id=${id} author=${author} title=${title} description=${description} version=${version} image=${repo_path}
${form_data}= Evaluate {'mldata=': ${data}}
${header}= Create Dictionary Authorization=${token}
${response}= Post Request session /v1/ml data=${form_data} headers=${header}
Should Be Equal As Strings ${response.status_code} 200
它应该作为字符串发送,而且您不需要等号
${form_data}= Evaluate {'mldata=': str(${data}).replace("'",'"')}
如您所见,我们必须将此作为
files=${form_data}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句