【发布时间】:2017-02-28 14:33:04
【问题描述】:
我正在使用 Jmeter 和 JSON 对 REST API 进行功能测试。我有文件上传工作,但我似乎无法让文件下载在 jmeter 中工作。我正在保存这篇文章中提到的回复:JMeter - File upload and file download scenario
当我这样做时,我正在接近但并不完全是我需要的。这是我得到的示例:
--0rVAdzesdQq7VrwJaRoYGm_UHdMD5nhi9_5w4u
Content-Disposition: form-data; name="api-test"; filename="LIBFILE1.txt"
Content-Type: text/plain
Content-Transfer-Encoding: binary
Library File for Automated Smoke Test
This file is used to test file library upload for automated smoke tests.
--0rVAdzesdQq7VrwJaRoYGm_UHdMD5nhi9_5w4u--
我怎样才能让下载只保存文件内容?在这个例子中,它应该只是:
Library File for Automated Smoke Test
This file is used to test file library upload for automated smoke tests.
这是一个简单的文本文件。我还想下载我正在上传的其他格式,包括 jpg、png、docx、pdf,但如果它附带了这些额外的数据,那就不对了。我想一旦我得到一个简单的文本文件,它将帮助我得到更难的文件类型。
【问题讨论】: