001: // HTTP.java
002: // $Id: HTTP.java,v 1.19 2003/01/20 15:59:53 ylafon Exp $
003: // (c) COPYRIGHT MIT and INRIA, 1996.
004: // Please first read the full copyright statement in file COPYRIGHT.html
005:
006: package org.w3c.www.http;
007:
008: public interface HTTP {
009: /**
010: * The major version of HTTP handled by that package.
011: */
012: public static final int major_number = 1;
013: /**
014: * The miniro version of HTTP handled by that package.
015: */
016: public static final int minor_number = 1;
017:
018: /**
019: * Some well know methods rfc2616 methods
020: */
021:
022: public static final String GET = "GET".intern();
023: public static final String HEAD = "HEAD".intern();
024: public static final String POST = "POST".intern();
025: public static final String PUT = "PUT".intern();
026: public static final String DELETE = "DELETE".intern();
027: public static final String OPTIONS = "OPTIONS".intern();
028: public static final String TRACE = "TRACE".intern();
029: public static final String CONNECT = "CONNECT".intern();
030:
031: // the 100-continue expect token
032: public static final String HTTP_100_CONTINUE = "100-continue";
033:
034: /**
035: * The version we emit with all replies.
036: * This version matches the version understood by the API, which does
037: * not necessarily reflect what is returned by <code>getMajorVersion
038: * </code> and <code>getMinorVersion</code>.
039: */
040: public static final byte byteArrayVersion[] = { (byte) 'H',
041: (byte) 'T', (byte) 'T', (byte) 'P', (byte) '/', (byte) '1',
042: (byte) '.', (byte) '1' };
043:
044: public static final String msg_100[] = { "Continue", // 100
045: "Switching Protocols" // 101
046: };
047:
048: public static final String msg_200[] = { "OK", // 200
049: "Created", // 201
050: "Accepted", // 202
051: "Non-Authoritative information", // 203
052: "No Content", // 204
053: "Reset Content", // 205
054: "Partial Content" // 206
055: };
056:
057: public static final String msg_300[] = { "Multiple Choices", // 300
058: "Moved Permanently", // 301
059: "Found", // 302
060: "See Other", // 303
061: "Not Modified", // 304
062: "Use Proxy", // 305
063: "", // no 306 def
064: "Temporary Redirect" // 307
065: };
066:
067: public static final String msg_400[] = { "Bad Request", // 400
068: "Unauthorized", // 401
069: "Payment Required", // 402
070: "Forbidden", // 403
071: "Not Found", // 404
072: "Method Not Allowed", // 405
073: "Not Acceptable", // 406
074: "Proxy Authentication Required", // 407
075: "Request Timeout", // 408
076: "Conflict", // 409
077: "Gone", // 410
078: "Length Required", // 411
079: "Precondition Failed", // 412
080: "Request Entity Too Large", // 413
081: "Request-URI Too Long", // 414
082: "Unsupported Media Type", // 415
083: "Requested Range Not Satisfiable", // 416
084: "Expectation Failed" // 417
085: };
086:
087: public static final String msg_500[] = { "Internal Server Error", // 500
088: "Not Implemented", // 501
089: "Bad Gateway", // 502
090: "Service Unavailable", // 503
091: "Gateway Timeout", // 504
092: "HTTP Version Not Supported", // 505
093: "", // no 506 def
094: "", // no 507 def
095: "", // no 508 def
096: "", // no 509 def
097: "Not Extended" // 510
098: };
099:
100: // HTTP status codes
101: public static final int CONTINUE = 100;
102: public static final int SWITCHING = 101;
103:
104: public static final int OK = 200;
105: public static final int CREATED = 201;
106: public static final int ACCEPTED = 202;
107: public static final int NON_AUTHORITATIVE_INFORMATION = 203;
108: public static final int NO_CONTENT = 204;
109: public static final int RESET_CONTENT = 205;
110: public static final int PARTIAL_CONTENT = 206;
111:
112: public static final int MULTIPLE_CHOICE = 300;
113: public static final int MOVED_PERMANENTLY = 301;
114: public static final int FOUND = 302;
115: public static final int SEE_OTHER = 303;
116: public static final int NOT_MODIFIED = 304;
117: public static final int USE_PROXY = 305;
118: public static final int TEMPORARY_REDIRECT = 307;
119:
120: public static final int BAD_REQUEST = 400;
121: public static final int UNAUTHORIZED = 401;
122: public static final int PAYMENT_REQUIRED = 402;
123: public static final int FORBIDDEN = 403;
124: public static final int NOT_FOUND = 404;
125: public static final int NOT_ALLOWED = 405;
126: public static final int NOT_ACCEPTABLE = 406;
127: public static final int PROXY_AUTH_REQUIRED = 407;
128: public static final int REQUEST_TIMEOUT = 408;
129: public static final int CONFLICT = 409;
130: public static final int GONE = 410;
131: public static final int LENGTH_REQUIRED = 411;
132: public static final int PRECONDITION_FAILED = 412;
133: public static final int REQUEST_ENTITY_TOO_LARGE = 413;
134: public static final int REQUEST_URI_TOO_LONG = 414;
135: public static final int UNSUPPORTED_MEDIA_TYPE = 415;
136: public static final int REQUESTED_RANGE_NOT_SATISFIABLE = 416;
137: public static final int EXPECTATION_FAILED = 417;
138:
139: public static final int INTERNAL_SERVER_ERROR = 500;
140: public static final int NOT_IMPLEMENTED = 501;
141: public static final int BAD_GATEWAY = 502;
142: public static final int SERVICE_UNAVAILABLE = 503;
143: public static final int GATEWAY_TIMEOUT = 504;
144: public static final int HTTP_VERSION_NOT_SUPPORTED = 505;
145: public static final int NOT_EXTENDED = 510;
146:
147: // Jigsaw server hacks:
148: public static final int NOHEADER = 1000;
149: public static final int DONE = 1001;
150:
151: }
|