soapUI:带文件附件的多部分/表单数据 REST 请求 [英] soapUI: multipart/form-data REST request with file attachments

查看:74
本文介绍了soapUI:带文件附件的多部分/表单数据 REST 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用soapUI 来测试REST Web 服务.有没有办法在多部分请求中附加带有其他参数的文件?我在面板中看到附件选项卡,但我无法为该附件提供参数名称,以便服务器可以识别.它没有帮助.

I am using soapUI for testing a REST web service. Is there a way to attach a file with the other parameters in a multipart request? I see the attachment tab in the panel but I cannot give that attachment a parameter name so that server can identify. It's not helping.

推荐答案

我找到了,但忘记在这里发布了.它不是那么直观.

I found it but forgot to post it here. It was not so intuitive.

  1. 在您的 REST 请求中,如果您可以看到附件选项卡,请打开它并使用 + 按钮添加附件.该文件的名称将显示完整路径.例如C:\temp\my-file.csv
  2. 在参数选项卡中,添加一个参数并为其命名.该参数的值为 file:C:\temp\my-file.csv
  3. 在 SoapUI 5.x 及更高版本中,您必须选中发布查询字符串"复选框.否则,文件将不会与请求一起发送.

应该是这样.附加文件时,如果在要求缓存文件时选择是,则不必在上面的步骤 2 中指定完整路径.文件参数的值应该是file:my-file.csv

That should be it. When attaching a file if you select Yes when it asks to Cache the file, you won't have to specify full path in step 2 above. The value of file parameter should be file:my-file.csv

这篇关于soapUI:带文件附件的多部分/表单数据 REST 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆