一、前言
关于http-2.2.1.jar源码包中sun.net.httpserver.Code请求状态返回编码静态类,对于常用返回状态100、200、500、404、301、302等做具体英文返回状态描述(对于中文具体描述参见“HTTP状态表”-点击对应tab页)。
二、源码说明
package sun.net.httpserver;@b@@b@class Code@b@{@b@ public static final int HTTP_CONTINUE = 100;@b@ public static final int HTTP_OK = 200;@b@ public static final int HTTP_CREATED = 201;@b@ public static final int HTTP_ACCEPTED = 202;@b@ public static final int HTTP_NOT_AUTHORITATIVE = 203;@b@ public static final int HTTP_NO_CONTENT = 204;@b@ public static final int HTTP_RESET = 205;@b@ public static final int HTTP_PARTIAL = 206;@b@ public static final int HTTP_MULT_CHOICE = 300;@b@ public static final int HTTP_MOVED_PERM = 301;@b@ public static final int HTTP_MOVED_TEMP = 302;@b@ public static final int HTTP_SEE_OTHER = 303;@b@ public static final int HTTP_NOT_MODIFIED = 304;@b@ public static final int HTTP_USE_PROXY = 305;@b@ public static final int HTTP_BAD_REQUEST = 400;@b@ public static final int HTTP_UNAUTHORIZED = 401;@b@ public static final int HTTP_PAYMENT_REQUIRED = 402;@b@ public static final int HTTP_FORBIDDEN = 403;@b@ public static final int HTTP_NOT_FOUND = 404;@b@ public static final int HTTP_BAD_METHOD = 405;@b@ public static final int HTTP_NOT_ACCEPTABLE = 406;@b@ public static final int HTTP_PROXY_AUTH = 407;@b@ public static final int HTTP_CLIENT_TIMEOUT = 408;@b@ public static final int HTTP_CONFLICT = 409;@b@ public static final int HTTP_GONE = 410;@b@ public static final int HTTP_LENGTH_REQUIRED = 411;@b@ public static final int HTTP_PRECON_FAILED = 412;@b@ public static final int HTTP_ENTITY_TOO_LARGE = 413;@b@ public static final int HTTP_REQ_TOO_LONG = 414;@b@ public static final int HTTP_UNSUPPORTED_TYPE = 415;@b@ public static final int HTTP_INTERNAL_ERROR = 500;@b@ public static final int HTTP_NOT_IMPLEMENTED = 501;@b@ public static final int HTTP_BAD_GATEWAY = 502;@b@ public static final int HTTP_UNAVAILABLE = 503;@b@ public static final int HTTP_GATEWAY_TIMEOUT = 504;@b@ public static final int HTTP_VERSION = 505;@b@@b@ static String msg(int paramInt)@b@ {@b@ switch (paramInt) {@b@ case 200:@b@ return " OK";@b@ case 100:@b@ return " Continue";@b@ case 201:@b@ return " Created";@b@ case 202:@b@ return " Accepted";@b@ case 203:@b@ return " Non-Authoritative Information";@b@ case 204:@b@ return " No Content";@b@ case 205:@b@ return " Reset Content";@b@ case 206:@b@ return " Partial Content";@b@ case 300:@b@ return " Multiple Choices";@b@ case 301:@b@ return " Moved Permanently";@b@ case 302:@b@ return " Temporary Redirect";@b@ case 303:@b@ return " See Other";@b@ case 304:@b@ return " Not Modified";@b@ case 305:@b@ return " Use Proxy";@b@ case 400:@b@ return " Bad Request";@b@ case 401:@b@ return " Unauthorized";@b@ case 402:@b@ return " Payment Required";@b@ case 403:@b@ return " Forbidden";@b@ case 404:@b@ return " Not Found";@b@ case 405:@b@ return " Method Not Allowed";@b@ case 406:@b@ return " Not Acceptable";@b@ case 407:@b@ return " Proxy Authentication Required";@b@ case 408:@b@ return " Request Time-Out";@b@ case 409:@b@ return " Conflict";@b@ case 410:@b@ return " Gone";@b@ case 411:@b@ return " Length Required";@b@ case 412:@b@ return " Precondition Failed";@b@ case 413:@b@ return " Request Entity Too Large";@b@ case 414:@b@ return " Request-URI Too Large";@b@ case 415:@b@ return " Unsupported Media Type";@b@ case 500:@b@ return " Internal Server Error";@b@ case 501:@b@ return " Not Implemented";@b@ case 502:@b@ return " Bad Gateway";@b@ case 503:@b@ return " Service Unavailable";@b@ case 504:@b@ return " Gateway Timeout";@b@ case 505:@b@ return " HTTP Version Not Supported"; }@b@ return "";@b@ }@b@}