sorry accepted<span></span> is 202, not 201<br><br>On Wednesday, April 29, 2015, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 5:50 PM, Lukáš Fryč <span dir="ltr">&lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;lukas.fryc@gmail.com&#39;);" target="_blank">lukas.fryc@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey guys,<div><br></div><div>one issues Tadeas identified during testing sender endpoint via Java Sender lib is connected to this quiet change in the REST response from REST Sender endpoint (we added text/plain response specification):</div><div><br></div><div><a href="https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/sender/PushNotificationSenderEndpoint.java#L107" target="_blank">https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/sender/PushNotificationSenderEndpoint.java#L107</a><br></div><div><br></div><div><br></div><div>As we were always responding with &quot;Job submitted&quot;, admin-ui client started to complain about the response not being JSON. So obvious fix was change that to text/plain, right?</div><div><br></div><div>Not really.. some clients like Java Sender lib already expects application/json and JAX-RS then refuses these requests:</div><div><br></div><div><a href="https://github.com/aerogear/aerogear-unifiedpush-java-client/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/http/HttpClient.java#L82" target="_blank">https://github.com/aerogear/aerogear-unifiedpush-java-client/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/http/HttpClient.java#L82</a><br></div><div><br></div><div><br></div><div><br></div><div>The question is, what should be the correct response?</div><div><br></div><div>There are many options, I would be perfectly fine with 204 No Content reply,</div></div></blockquote><div><br></div><div><br></div><div>201/accept is the way to go - since the server accepts a job, for further processing.</div><div><br></div><div><br></div><div>HOWEVER, I am fine w/ skipping the content &quot;jib submitted&quot; on the beta.1 release</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>but JSON might be more appropriate for future extensions, we may want to return e.g. PushMessageInformation#id or something else as part of the response.</div><div><br></div><div>So, wouldn&#39;t be application/json more appropriate than text/plain? We may send empty body now {}.</div><div><br></div><div><br></div><div>Is this something we want to address for Alpha? Or should we release fixed Java Sender lib?</div></div></blockquote><div><br></div><div>if needed, we need an update of the sender lib - I think due to the new format for sending pushes, we anyways need a 1.1.0-alpha.n release of that lib. Perhaps we can have one after the server is out, Sebi?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div><div>Cheers,</div><div><br></div><div>~ Lukas</div></div>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;aerogear-dev@lists.jboss.org&#39;);" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a></div>
</div></div>
</blockquote><br><br>-- <br>Sent from Gmail Mobile<br>