--- /dev/null
+// HTTP.java\r
+// $Id: HTTP.java,v 1.1 2010/06/15 12:19:47 smhuang Exp $\r
+// (c) COPYRIGHT MIT and INRIA, 1996.\r
+// Please first read the full copyright statement in file COPYRIGHT.html\r
+\r
+package org.w3c.www.http;\r
+\r
+public interface HTTP {\r
+ /**\r
+ * The major version of HTTP handled by that package.\r
+ */\r
+ public static final int major_number = 1;\r
+ /**\r
+ * The miniro version of HTTP handled by that package.\r
+ */\r
+ public static final int minor_number = 1;\r
+\r
+ /**\r
+ * Some well know methods rfc2616 methods\r
+ */\r
+\r
+ public static final String GET = "GET".intern();\r
+ public static final String HEAD = "HEAD".intern();\r
+ public static final String POST = "POST".intern();\r
+ public static final String PUT = "PUT".intern();\r
+ public static final String DELETE = "DELETE".intern();\r
+ public static final String OPTIONS = "OPTIONS".intern();\r
+ public static final String TRACE = "TRACE".intern();\r
+ public static final String CONNECT = "CONNECT".intern();\r
+\r
+ // the 100-continue expect token\r
+ public static final String HTTP_100_CONTINUE = "100-continue";\r
+\r
+ /**\r
+ * The version we emit with all replies. \r
+ * This version matches the version understood by the API, which does\r
+ * not necessarily reflect what is returned by <code>getMajorVersion\r
+ * </code> and <code>getMinorVersion</code>.\r
+ */\r
+ public static final byte byteArrayVersion[] = {\r
+ (byte) 'H', (byte) 'T', (byte) 'T', (byte) 'P',\r
+ (byte) '/', (byte) '1', (byte) '.', (byte) '1'\r
+ };\r
+\r
+ public static final String msg_100[] = {\r
+ "Continue", // 100\r
+ "Switching Protocols" // 101\r
+ };\r
+\r
+ public static final String msg_200[] = {\r
+ "OK", // 200\r
+ "Created", // 201\r
+ "Accepted", // 202\r
+ "Non-Authoritative information", // 203\r
+ "No Content", // 204\r
+ "Reset Content", // 205\r
+ "Partial Content" // 206\r
+ };\r
+\r
+ public static final String msg_300[] = {\r
+ "Multiple Choices", // 300\r
+ "Moved Permanently", // 301\r
+ "Found", // 302\r
+ "See Other", // 303\r
+ "Not Modified", // 304\r
+ "Use Proxy", // 305\r
+ "", // no 306 def\r
+ "Temporary Redirect" // 307\r
+ };\r
+\r
+ public static final String msg_400[] = {\r
+ "Bad Request", // 400\r
+ "Unauthorized", // 401\r
+ "Payment Required", // 402\r
+ "Forbidden", // 403\r
+ "Not Found", // 404\r
+ "Method Not Allowed", // 405\r
+ "Not Acceptable", // 406\r
+ "Proxy Authentication Required", // 407\r
+ "Request Timeout", // 408\r
+ "Conflict", // 409\r
+ "Gone", // 410\r
+ "Length Required", // 411\r
+ "Precondition Failed", // 412\r
+ "Request Entity Too Large", // 413\r
+ "Request-URI Too Long", // 414\r
+ "Unsupported Media Type", // 415\r
+ "Requested Range Not Satisfiable", // 416\r
+ "Expectation Failed" // 417\r
+ };\r
+\r
+ public static final String msg_500[] = {\r
+ "Internal Server Error", // 500\r
+ "Not Implemented", // 501\r
+ "Bad Gateway", // 502\r
+ "Service Unavailable", // 503\r
+ "Gateway Timeout", // 504\r
+ "HTTP Version Not Supported", // 505\r
+ "", // no 506 def\r
+ "", // no 507 def\r
+ "", // no 508 def\r
+ "", // no 509 def\r
+ "Not Extended" // 510\r
+ };\r
+\r
+ // HTTP status codes\r
+ public static final int CONTINUE = 100;\r
+ public static final int SWITCHING = 101;\r
+\r
+ public static final int OK = 200;\r
+ public static final int CREATED = 201;\r
+ public static final int ACCEPTED = 202;\r
+ public static final int NON_AUTHORITATIVE_INFORMATION = 203;\r
+ public static final int NO_CONTENT = 204;\r
+ public static final int RESET_CONTENT = 205;\r
+ public static final int PARTIAL_CONTENT = 206;\r
+\r
+ public static final int MULTIPLE_CHOICE = 300;\r
+ public static final int MOVED_PERMANENTLY = 301;\r
+ public static final int FOUND = 302;\r
+ public static final int SEE_OTHER = 303;\r
+ public static final int NOT_MODIFIED = 304;\r
+ public static final int USE_PROXY = 305;\r
+ public static final int TEMPORARY_REDIRECT = 307;\r
+\r
+ public static final int BAD_REQUEST = 400;\r
+ public static final int UNAUTHORIZED = 401; \r
+ public static final int PAYMENT_REQUIRED = 402;\r
+ public static final int FORBIDDEN = 403;\r
+ public static final int NOT_FOUND = 404;\r
+ public static final int NOT_ALLOWED = 405;\r
+ public static final int NOT_ACCEPTABLE = 406;\r
+ public static final int PROXY_AUTH_REQUIRED = 407;\r
+ public static final int REQUEST_TIMEOUT = 408;\r
+ public static final int CONFLICT = 409;\r
+ public static final int GONE = 410;\r
+ public static final int LENGTH_REQUIRED = 411;\r
+ public static final int PRECONDITION_FAILED = 412;\r
+ public static final int REQUEST_ENTITY_TOO_LARGE = 413;\r
+ public static final int REQUEST_URI_TOO_LONG = 414;\r
+ public static final int UNSUPPORTED_MEDIA_TYPE = 415;\r
+ public static final int REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r
+ public static final int EXPECTATION_FAILED = 417;\r
+\r
+ public static final int INTERNAL_SERVER_ERROR = 500;\r
+ public static final int NOT_IMPLEMENTED = 501;\r
+ public static final int BAD_GATEWAY = 502;\r
+ public static final int SERVICE_UNAVAILABLE = 503;\r
+ public static final int GATEWAY_TIMEOUT = 504;\r
+ public static final int HTTP_VERSION_NOT_SUPPORTED = 505;\r
+ public static final int NOT_EXTENDED = 510;\r
+\r
+ // Jigsaw server hacks:\r
+ public static final int NOHEADER = 1000;\r
+ public static final int DONE = 1001;\r
+\r
+}\r