留言板

liferay rest web service http status code

thumbnail
Muhammed Shafeek V,修改在7 年前。

liferay rest web service http status code

Regular Member 帖子: 140 加入日期: 13-7-22 最近的帖子
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,修改在7 年前。

RE: liferay rest web service http status code

Regular Member 帖子: 140 加入日期: 13-7-22 最近的帖子
Any Idea?
thumbnail
David H Nebinger,修改在6 年前。

RE: liferay rest web service http status code

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
It's not going to be possible AFAIK.








Come meet me at the 2017 LSNA!