Including --data-binary in Robot Framework request

安稳与你 提交于 2019-12-11 05:42:47

问题


I'm posting a image (.svg/.png) using Robot Framework (the tabular pythonic way) using the --data-binary flag to test a rest API. The documentation suggests it accepts binary data, but not how to use --data-binary. See robot request docs The post in CURL looks like this:

curl -w "\n%{http_code}\n" -H "Content-Type: image/png" -u user:pass --data-binary "data=@~/someImage.png" -X POST "http://website/{id}"

The test case is formatted like so:

${result} =         Post        url=${ROOT}/website/{id}        data=${if-post-has-data}        headers=&{REQ_HEADER}

Any suggestions?

来源:https://stackoverflow.com/questions/45643205/including-data-binary-in-robot-framework-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!