SeB*_*eBo 12 rest http http-post firefox-addon
有没有人知道一个小测试工具(如Firefox的Rest/RestTool)能够上传文件并在同一个帖子请求(Multipart)中发送文本正文?
它不是一个firefox-addon,但我真正推荐的是使用curl工具.它在使用RESTful HTTP API时非常适合,因为它非常接近HTTP协议.因为它是基于CLI的,所以它作为图形插件更灵活(例如,您可以邮寄或者可以通过示例调用来记录您的API).
例如,使用curl执行多部分请求将是:
# with '-v' verbose-switch you see some headers
# with '-F' you are "activating" single multiparts
# with '@' you are referencing file
curl -v -F myPartName1=@file1.txt -F myPartName2=@file2.txt http://host.com/your/multipart/endpoint
# if server needs it you can also pass Content-Type with single files
... -F "myPartName1=@file1.txt;type=text/plain" ...
您期望在服务器端使用什么类型的多部分(例如,multipart/form-data或multipart/mixed).
有没有理由为什么它必须是一个firefox插件?我见过人们使用RestClient,但我从未见过它与multipart一起工作.