Hi all,
I am working on doing a HTTP POST using android java restlet plugin into a url
of Django server.
However, the Django is coded in such a way that it return the cause of error
(message) to client side, and prints the status of error message on Django log.
for example, if I do HTTP POST on /api/login/ and it returns HTTP 500 (Internal
Server Error) , the only thing that's printed on the Server side is
INFO:root:"POST /api/login/ HTTP/1.1" 500 -
The cause of this error is returned to client, I have tried following method to
print the cause:
Representation response=null;
try{
response= clientResource.post(form.getWebRepresentation(null));
}catch(ResourceException e){
System.out.println(e.toString());
System.out.println("Status Below:");
System.out.println(e.getStatus());
e.printStackTrace();
}
But the only thing that got printed using this is :
I/System.out( 256): Internal Server Error (500) -
I/System.out( 256): Message Below:
I/System.out( 256): Internal Server Error
W/System.err( 256): Internal Server Error (500) -
i.e. same information as I am getting on server side.
Somehow, I want to get the content of the error.
Is there some way I can get it?
Thanks,
Gautam Bajaj
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2972501