Foren
liferay rest web service http status code
Muhammed Shafeek V, geändert vor 7 Jahren.
liferay rest web service http status code
Regular Member Beiträge: 140 Beitrittsdatum: 22.07.13 Neueste Beiträge
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..
Muhammed Shafeek V, geändert vor 7 Jahren.
RE: liferay rest web service http status code
Regular Member Beiträge: 140 Beitrittsdatum: 22.07.13 Neueste Beiträge
Any Idea?
David H Nebinger, geändert vor 6 Jahren.