I just ask for help from the nearby comunity on StackOverflow upload XML or CSV file using the REST API in Java .
URL :
Remote Address:127.0.0.1:8080 Request URL:http://localhost:8080/HSMV5/api/import Request Method:POST
Request Playload :
------WebKitFormBoundaryTnLhEykB6lreFMtz Content-Disposition: form-data; name="aaaa.xml"; filename="aaaa.xml" Content-Type: text/xml ------WebKitFormBoundaryTnLhEykB6lreFMtz--
here is my source code:
@Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes({ MediaType.APPLICATION_JSON, MediaType.MULTIPART_FORM_DATA }) public class Dispatcher { @POST @Path("/import") public Response importpostFile( @FormDataParam("file") InputStream uploadedInputStream, @FormDataParam("file") FormDataContentDisposition fileDetail) throws HsmRestServiceException { System.out.println(fileDetail.getFileName()); return importFile.doPost(null); } }
at compile variables returns null :
uploadedInputStream : null fileDetail : null
thank's
No comments:
Post a Comment