Mark Knoop wrote:

If one wants to return an error to the client because they have not included the correct parameters for the CGI request, should one use one of the HTTP status codes and if so which one?

Generally I don't use the HTTP status codes unless there is an error on the HTTP level. So for HTTP redirection, general server problem, etc. But HTTP codes are not application specific codes.

And then is it ok/sensible to include an error message in the body?

For me application specific codes should be part of the application, so it's part of the response. Are you returning your response as structured data (XML, JSON, etc)? If so, I'd just define a part of the spec that lists your application specific error codes and what they mean. If your response is not structured data, then just put a human readable error in the response.

--
Michael Peters
Plus Three, LP


#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to