tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Kildén <karl.kil...@gmail.com>
Subject JAX-RS: Posting DTO (as xml entity) new requirement is file attachment?
Date Thu, 22 Dec 2016 08:48:57 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message