POST方法中的可选请求参数问题

时间:2017-12-27 07:48:33

标签: java rest post optional-parameters http-request-parameters

我有一个POST API,如下所示:

@POST
@Path("/api/analysis/s3file/{filename}")
@Produces("application/json")
public Response analysis(@PathParam("filename") String filename, @RequestParam(value = "errorDesc", required = false, defaultValue  ="true") String errorDesc) ()

但是当我调用此http://localhost:8080/MyApp/api/analysis/s3file/abc.zip?errorDesc=true这个API时,我无法获取请求参数'errorDesc'。

当我打印字符串errorDesc的值时,我看到它是请求有效负载的值(例如:------ WebKitFormBoundaryEu2iBOEbKojgV3wO - )

有人可以帮我解决这个问题。我检查过相关问题,但无法确定问题。

0 个答案:

没有答案