dhis2-devs-core team mailing list archive
-
dhis2-devs-core team
-
Mailing list archive
-
Message #00338
Re: Changed response payload in web-api
This change have now been applied to all of the web-api, please if you see
any weird "{ "message": "..." } error messages, report back to me. If you
see it in your own apps, just to JSON.parse(responseText).message.
--
Morten
On Wed, Jul 8, 2015 at 12:07 PM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
wrote:
> Hi everyone
>
> As part of the continued change to WebMessage based responses in the
> web-api, I have now more or less removed all old "text based" responses..
> there might be a few more, but I will go through it today and remove all of
> it. If you have any code that assumes a text based payload, you will need
> to change your code (it will use accept headers / extension to decide on
> xml or json)
>
> A more intrusive change is that I have now wrapped ImportSummary /
> ImportTypeSummary and ImportSummaries in a WebMessageResponse. The update
> to your code is easy enough, use o.response / o.response.responseType to
> get your summary, it will now also switch to WARNING if there are any
> conflicts / ignores detected, it will also give a (possible) user facing
> message.
>
> If you see any places where this have not been changed, please report back
> to me and I will update.
>
> I'm keeping the response format in /api/metadata as is it for legacy
> reasons (it will be replaced in 2.21/2.22 anyways).
>
> --
> Morten
>
References