Finally I get it working. I have to associate a 2** code with a bogus empty
representaton (null representation doesn't work). Is this a bug in restlet?
// inside my resource class
getResponse().setStatus(Status.SUCCESS_NO_CONTENT, "No Data");
return new StringRepresentation("", MediaType.ALL);
Even I use 204 status (Status.SUCCESS_NO_CONTENT)and return a null
representation, the response status code that the client receives is still 404.
> which HTTP server connector are you
> using, and which client are you using to test? Then I can set it up to verify.
I use Simple Server connector
Hello all,
from what I see in the code of the "Resource" class, when a resource
does not return a representation (ie null, not empty) and returns a 2**
status (except 204), then a 404 status is automatically returned.
That is to say, at this moment, you can associate a 204 status and a
null rep
For pragmatic reasons, unless your application only operates over a network
you configure and control, with clients you configure and control, I'd avoid
customizing status codes. Browsers, HTTP libraries, proxies, and
higher-layer switches may behave in undefined ways when they encounter
non-stand
I know this doesn't answer your question, but doesn't 204 do what you want
already?
--Erik
On Tue, Dec 9, 2008 at 6:58 PM, <[EMAIL PROTECTED]> wrote:
> I define a customized status code(299) to handle the case of a success
> request with no data found. I tried two different ways to set this stat
I define a customized status code(299) to handle the case of a success request
with no data found. I tried two different ways to set this status code(see
below), but the status code client receives is 404, not 299. There's no place
in my codes to set status to 404, so this 404 must be generated
6 matches
Mail list logo