Hi you can use multipart for it: http://cxf.apache.org/docs/jax-rs-multiparts.html
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://blog-rmannibucau.rhcloud.com> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-12-22 9:48 GMT+01:00 Karl Kildén <[email protected]>: > Hi! > > I have made use of the Client API in jax-rs 2 and the mediaType is XML. So > far everything is working fine and I am able to send a pretty large entity. > > Now I need to include multiple files? This is what I have now: > > > Response response = > client.target(builder).request(mediaType()).put(Entity.entity(dto, > mediaType())); > > Just a simple post basically. Is it even best practice/possible to send > both files and DTO in the same post? > > I know I can base64 the files but it seems to be considered awful by many > and I can understand that considering the increased size of the message. > > I am thinking about posting the files i a separate post that needs to link > it with the previous request but that's just not very ACID :( > > Any advice on this one? Cheers >
