欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

用REST service上传和下载附件

程序员文章站 2022-07-14 12:45:50
...
Quick walkthrough:

1) Create a new Project
2) Create a TestSuite in the Project
3) Create a TestCase in the TestSuite
4) Add an HTTP TestRequest Step to the TestCase
-> Set the endpoint to the URL you want to upload to
-> Set the method to POST (or PUT)
5) In the Request Editor add the File you want to upload to the Attachments tab
6) Set the Media-Type of the POST Body to the same as the Content-Type of the attached File
7) Send the request!

Hope I got that right :-)

Set the attachment and make sure that your Media Type is set to multipart/form-data (I'm assuming you wish to simulate a HTTP form). You also need to change the attachments name to match what the server is expecting it to be. If you have other parameters to send along with the request, you need to check the "Post QueryString" checkbox to send the parameters in the POST body.


https://*.com/questions/12467901/soapui-multipart-form-data-rest-request-with-file-attachments

上一篇: Maven FAQ

下一篇: SCJP 认证考试指南