This is the api look like. I want to write a jmeter script to upload a csv file. I tried by putting Content-Type: multipart/form-data in HTTP header manager. then added parameter appId, fileName and putted an csv file in Files Upload tab in JMeter. But my response is showing 400 - bad request.
@POST
@Path("/{cid}")
@Consumes({ MediaType.MULTIPART_FORM_DATA,
MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_JSON})
public Response uploadFile(
@Context UriInfo ui,
@PathParam("cid") String cid,
@QueryParam("appId") String appId,
@FormDataParam("file") InputStream inputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail,
@FormDataParam("fileName") String fileName,
@Context SecurityContext securityContext) throws IOException {
// code goes here
}