Hello

and thanks whoevers reads the question.


In the CXF doc here

http://cxf.apache.org/docs/jax-rs-multiparts.html
<http://cxf.apache.org/docs/jax-rs-multiparts.html>  

it says:

"

Finally, multipart/form-data requests with multiple files (file uploads) can
be supported too. For example, this request can be handled by a method with
the signature like :

@POST
@Path("/books/filesform")
@Produces("text/xml")
@Consumes("multipart/form-data")
public Response addBookFilesForm(@Multipart("owner") String name,
                                 @Multipart("files") List<Book> books) {} 

"



But how to generate that request from the java client side?

This is the request content:


--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
Content-Disposition: form-data; name="owner"
Content-Type: text/plain

Larry
--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
Content-Disposition: form-data; name="files"
Content-Type: multipart/mixed; boundary=_Part_4_701508.1145579811786

--_Part_4_701508.1145579811786
Content-Disposition: form-data; name="book1"
Content-Type: application/json; charset=US-ASCII
Content-Transfer-Encoding: 8bit

{"Book":{"name":"CXF in Action - 1","id":123}}
--_Part_4_701508.1145579811786
Content-Disposition: form-data; name="book2"
Content-Type: application/json; charset=US-ASCII
Content-Transfer-Encoding: 8bit

{"Book":{"name":"CXF in Action - 2%","id":124}}
--_Part_4_701508.1145579811786--
--bqJky99mlBWa-ZuqjC53mG6EzbmlxB--


Thanks



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Reply via email to