Fórum

liferay rest web service http status code

thumbnail
Muhammed Shafeek V, modificado 7 Anos atrás.

liferay rest web service http status code

Regular Member Postagens: 140 Data de Entrada: 22/07/13 Postagens Recentes
Hi,
Is that possible to return specific http status code from Liferay rest webservice? In my case Liferay web service always return the OK : 200 status code even when the request can not be proceeded or even when exeception fired.

For example running the following request :
https://myportal.com/api/secure/jsonws/announcementsentry/get-entry/entry-id/1

Where entryId is an id which doesn't exist, return :

Status code : 200 OK
Response body:
{
"exception": "com.liferay.portlet.announcements.NoSuchEntryException: No AnnouncementsEntry exists with the primary key 1"
}

Above case Is there any solution to return some other staus code instead of Status code : 200 OK? Atleast from the service of a custom portlet.
I am using Liferay Server 6.2


Any idea? Please share..
thumbnail
Muhammed Shafeek V, modificado 7 Anos atrás.

RE: liferay rest web service http status code

Regular Member Postagens: 140 Data de Entrada: 22/07/13 Postagens Recentes
Any Idea?
thumbnail
David H Nebinger, modificado 6 Anos atrás.

RE: liferay rest web service http status code

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
It's not going to be possible AFAIK.








Come meet me at the 2017 LSNA!