掲示板

liferay rest web service http status code

thumbnail
7年前 に Muhammed Shafeek V によって更新されました。

liferay rest web service http status code

Regular Member 投稿: 140 参加年月日: 13/07/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
7年前 に Muhammed Shafeek V によって更新されました。

RE: liferay rest web service http status code

Regular Member 投稿: 140 参加年月日: 13/07/22 最新の投稿
Any Idea?
thumbnail
6年前 に David H Nebinger によって更新されました。

RE: liferay rest web service http status code

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
It's not going to be possible AFAIK.








Come meet me at the 2017 LSNA!