<div dir="ltr">Hey guys!<div><br></div><div>I&#39;m working on REST Server refactoring and I changed some of the previous behavior. Having in mind that we are implementing this in a minor release, I tried to make those changes really cosmetic:</div><div><ul><li>RestEASY as well as Servlet API have been removed from modules and BOM. If your app relied on it, you&#39;ll need to specify them separately in your pom.</li><li>Previous implementation picked application/text as a default content type. I replaced it with text/plain with charset which is more precise and seems to be more widely adopted.</li><li>Putting an entry without any TTL nor Idle Time made it living forever (which was BTW aligned with the docs). I switched to server configured defaults in this case. If you want to have an entry that lives forever, just specify 0 or -1 there.</li><li>Requesting an entry with wrong mime type (imagine it was stored using application/octet-stream and now you&#39;re requesting text/plain) cased Bad Request. Now I switched it to Not Acceptable which was designed specially to cover this type of use case.</li><li>In compatibility mode the server often tried to &quot;guess&quot; the mimetype (the decision was often between text/plain and application/octet-stream). I honestly think it was a wrong move and made the server side code very hard to read and predict what would be the result. Now the server always returns text/plain by default. If you want to get a byte stream back, just add `Accept: application/octet-stream`.</li><li>The server can be started with port 0. This way you are 100% sure that it will start using a unique port without colliding with any other service.</li><li>The REST server hosts HTML page if queried using GET on default context. I think it was a bug that it didn&#39;t work correctly before.</li><li>UTF-8 charset is now the default. You may always ask the server to return different encoding using Accept header. The charset is not returned with binary mime types.</li><li>If a HEAD request results in an error, a message will be returned to the client. Even though this behavior breaks Commons HTTP Client (HEAD requests are handled slightly differently and causes the client to hang if a payload is returned), I think it&#39;s beneficial to tell the user what went wrong. It&#39;s worth to mention that Jetty/Netty HTTP clients work correctly.</li><li>RestServer doesn&#39;t implement Lifecycle now. The protocol server doesn&#39;t support start() method without any arguments. You always need to specify configuration + Embedded Cache Manager.</li></ul><div>Even though it&#39;s a long list, I think all those changes were worth it. Please let me know if you don&#39;t agree.</div></div><div><br></div><div>Thanks,</div><div>Sebastian</div><div><br></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><p class="inbox-inbox-fullname-container" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:uppercase"><span class="inbox-inbox-firstname-container" style="box-sizing:border-box">SEBASTIAN</span><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-lastname-container" style="box-sizing:border-box">ŁASKAWIEC</span></p><p class="inbox-inbox-position-container" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px;margin:0px 0px 4px;text-transform:uppercase"><span class="inbox-inbox-position" style="box-sizing:border-box">INFINISPAN DEVELOPER</span></p><p class="inbox-inbox-legal-container" style="box-sizing:border-box;font-family:overpass,sans-serif;margin:0px;font-size:10px;color:rgb(153,153,153)"><a class="inbox-inbox-redhat-anchor" href="https://www.redhat.com/" target="_blank" style="box-sizing:border-box;color:rgb(0,136,206);margin:0px;text-decoration:none">Red Hat<span class="inbox-inbox-Apple-converted-space"> </span><span style="box-sizing:border-box">EMEA</span></a></p><table border="0" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td width="100px" style="box-sizing:border-box"><a href="https://red.ht/sig" style="box-sizing:border-box"><img width="90" height="auto" style="box-sizing: border-box;" src="https://www.redhat.com/files/brand/email/sig-redhat.png"></a></td></tr></tbody></table></div></div>