掲示板
liferay rest web service http status code
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.
Any idea? Please share..
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..
7年前 に Muhammed Shafeek V によって更新されました。
RE: liferay rest web service http status code
Regular Member 投稿: 140 参加年月日: 13/07/22 最新の投稿
Any Idea?
6年前 に David H Nebinger によって更新されました。