sorry accepted is 202, not 201
On Wednesday, April 29, 2015, Matthias Wessendorf <matzew(a)apache.org> wrote:
On Wed, Apr 29, 2015 at 5:50 PM, Lukáš Fryč <lukas.fryc(a)gmail.com
<javascript:_e(%7B%7D,'cvml','lukas.fryc@gmail.com');>> wrote:
> Hey guys,
>
> 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):
>
>
>
https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs...
>
>
> As we were always responding with "Job submitted", admin-ui client
> started to complain about the response not being JSON. So obvious fix was
> change that to text/plain, right?
>
> Not really.. some clients like Java Sender lib already expects
> application/json and JAX-RS then refuses these requests:
>
>
>
https://github.com/aerogear/aerogear-unifiedpush-java-client/blob/master/...
>
>
>
> The question is, what should be the correct response?
>
> There are many options, I would be perfectly fine with 204 No Content
> reply,
>
201/accept is the way to go - since the server accepts a job, for further
processing.
HOWEVER, I am fine w/ skipping the content "jib submitted" on the beta.1
release
>
> 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.
>
> So, wouldn't be application/json more appropriate than text/plain? We may
> send empty body now {}.
>
>
> Is this something we want to address for Alpha? Or should we release
> fixed Java Sender lib?
>
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?
>
>
> Cheers,
>
> ~ Lukas
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev(a)lists.jboss.org
> <javascript:_e(%7B%7D,'cvml','aerogear-dev@lists.jboss.org');>
>
https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
--
Matthias Wessendorf
blog:
http://matthiaswessendorf.wordpress.com/
sessions:
http://www.slideshare.net/mwessendorf
twitter:
http://twitter.com/mwessendorf