Custom status

39 views
Skip to first unread message

robinp...@gmail.com

unread,
Jan 31, 2015, 1:09:57 AM1/31/15
to google-a...@googlegroups.com

 Hi All,

I am working on RESTful web services using java. We all love REST-full-ness, so I'd like to return more REST-ful status codes from my endpoints. (Example: 201 CREATED along with JSON contents in response body. But I can't find any way to set the HTTP status code. Can anyone help please? I have seen many posts which says that currently custom status codes are not supported. Whether its still not supported or is there a way to do it rather than writing exception classes. Because if we write exception classes then we cant return JSON in response body.

 Please do reply.. Thanks for the help.

Vinny P

unread,
Feb 3, 2015, 3:42:38 AM2/3/15
to google-a...@googlegroups.com
On Sat, Jan 31, 2015 at 12:09 AM, <robinp...@gmail.com> wrote:
I am working on RESTful web services using java. We all love REST-full-ness, so I'd like to return more REST-ful status codes from my endpoints. (Example: 201 CREATED along with JSON contents in response body. But I can't find any way to set the HTTP status code. Can anyone help please? I have seen many posts which says that currently custom status codes are not supported. Whether its still not supported or is there a way to do it rather than writing exception classes. Because if we write exception classes then we cant return JSON in response body.


Unfortunately it's currently not supported - the only way to return a custom status code is to use exception classes (as you remarked on): https://cloud.google.com/appengine/docs/java/endpoints/exceptions

 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
  
Reply all
Reply to author
Forward
0 new messages