【问题标题】:Testing a Rest Api which accepts a zip file as input测试接受 zip 文件作为输入的 Rest Api
【发布时间】:2015-05-26 14:06:36
【问题描述】:

我有一个像下面这样的休息 Api。

@POST
@Path("/importFile")
@Consumes("application/zip")
@ApiOperation(value = "Importing File")
public List<String> importFile(InputStream is) throws IOException {
    ZipInputStream zipInputStream = new ZipInputStream(is);
    return importFile(zipInputStream);
}

如何测试它?

【问题讨论】:

  • 如果您正在寻找手动测试,也可以使用 postman 之类的工具

标签: java rest testing jersey


【解决方案1】:

你可以使用 curl 工具 -

curl -v -F file=@file1.txt -F http://testYouFile/endpoint

您还可以使用 chrome 插件,例如 postman 或 https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-10
    • 2021-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-14
    • 2017-09-01
    • 1970-01-01
    相关资源
    最近更新 更多