Multipart Rest based Java spring web service -
im new java based web service development. need create web service accepts multipart data(ex: zip file). please me out how mention in function.
below current web service code accepting data in form of json.
@requestmapping(value="/workitems/updatedata", method=requestmethod.post) @responsebody public object updatedata(@requestheader string devicetoken, @requestbody formfields[] formfields,httpservletresponse response) throws exception { //some code }
please guide me how accept multipart data in web service method.
thanks in advance.
@requestmapping( value ="/workitems/updatedata",method=requestmethod.post ,headers="accept=application/xml, application/json") public @responsebody object updatedata(httpservletresponse response,@requestheader string devicetoken, @requestparam ("file") multipartfile file) throws exception { }
you can support above.
Comments
Post a Comment