1 /* 2 * Copyright (C) 2007 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package tests.support; 18 19 interface Support_HttpConstants { 20 /** 2XX: generally "OK" */ 21 public static final int HTTP_OK = 200; 22 public static final int HTTP_CREATED = 201; 23 public static final int HTTP_ACCEPTED = 202; 24 public static final int HTTP_NOT_AUTHORITATIVE = 203; 25 public static final int HTTP_NO_CONTENT = 204; 26 public static final int HTTP_RESET = 205; 27 public static final int HTTP_PARTIAL = 206; 28 29 /** 3XX: relocation/redirect */ 30 public static final int HTTP_MULT_CHOICE = 300; 31 public static final int HTTP_MOVED_PERM = 301; 32 public static final int HTTP_MOVED_TEMP = 302; 33 public static final int HTTP_SEE_OTHER = 303; 34 public static final int HTTP_NOT_MODIFIED = 304; 35 public static final int HTTP_USE_PROXY = 305; 36 37 /** 4XX: client error */ 38 public static final int HTTP_BAD_REQUEST = 400; 39 public static final int HTTP_UNAUTHORIZED = 401; 40 public static final int HTTP_PAYMENT_REQUIRED = 402; 41 public static final int HTTP_FORBIDDEN = 403; 42 public static final int HTTP_NOT_FOUND = 404; 43 public static final int HTTP_BAD_METHOD = 405; 44 public static final int HTTP_NOT_ACCEPTABLE = 406; 45 public static final int HTTP_PROXY_AUTH = 407; 46 public static final int HTTP_CLIENT_TIMEOUT = 408; 47 public static final int HTTP_CONFLICT = 409; 48 public static final int HTTP_GONE = 410; 49 public static final int HTTP_LENGTH_REQUIRED = 411; 50 public static final int HTTP_PRECON_FAILED = 412; 51 public static final int HTTP_ENTITY_TOO_LARGE = 413; 52 public static final int HTTP_REQ_TOO_LONG = 414; 53 public static final int HTTP_UNSUPPORTED_TYPE = 415; 54 55 /** 5XX: server error */ 56 public static final int HTTP_SERVER_ERROR = 500; 57 public static final int HTTP_INTERNAL_ERROR = 501; 58 public static final int HTTP_BAD_GATEWAY = 502; 59 public static final int HTTP_UNAVAILABLE = 503; 60 public static final int HTTP_GATEWAY_TIMEOUT = 504; 61 public static final int HTTP_VERSION = 505; 62 63 /** Method IDs */ 64 public static final int UNKNOWN_METHOD = 0; 65 public static final int GET_METHOD = 1; 66 public static final int HEAD_METHOD = 2; 67 public static final int POST_METHOD = 3; 68 69 public static final String[] requestHeaders = { 70 "cache-control", 71 "connection", 72 "date", 73 "pragma", 74 "trailer", 75 "transfer-encoding", 76 "upgrade", 77 "via", 78 "warning", 79 "accept", 80 "accept-charset", 81 "accept-encoding", 82 "accept-language", 83 "authorization", 84 "expect", 85 "from", 86 "host", 87 "if-match", 88 "if-modified-since", 89 "if-none-match", 90 "if-range", 91 "if-unmodified-since", 92 "max-forwards", 93 "proxy-authentication", 94 "range", 95 "referer", 96 "te", 97 "user-agent", 98 "keep-alive", 99 "allow", 100 "content-encoding", 101 "content-language", 102 "content-length", 103 "content-location", 104 "content-md5", 105 "content-range", 106 "content-type", 107 "expires", 108 "last-modified", 109 "location", 110 "server" 111 112 }; 113 114 public static final int REQ_UNKNOWN = -1; 115 public static final int REQ_CACHE_CONTROL = 0; 116 public static final int REQ_CONNECTION = 1; 117 public static final int REQ_DATE = 2; 118 public static final int REQ_PRAGMA = 3; 119 public static final int REQ_TRAILER = 4; 120 public static final int REQ_TRANSFER_ENCODING = 5; 121 public static final int REQ_UPGRADE = 6; 122 public static final int REQ_VIA = 7; 123 public static final int REQ_WARNING = 8; 124 public static final int REQ_ACCEPT = 9; 125 public static final int REQ_ACCEPT_CHARSET = 10; 126 public static final int REQ_ACCEPT_ENCODING = 11; 127 public static final int REQ_ACCEPT_LANGUAGE = 12; 128 public static final int REQ_AUTHORIZATION = 13; 129 public static final int REQ_EXPECT = 14; 130 public static final int REQ_FROM = 15; 131 public static final int REQ_HOST = 16; 132 public static final int REQ_IF_MATCH = 17; 133 public static final int REQ_IF_MODIFIED_SINCE = 18; 134 public static final int REQ_IF_NONE_MATCH = 19; 135 public static final int REQ_IF_RANGE = 20; 136 public static final int REQ_IF_UNMODIFIED_SINCE = 21; 137 public static final int REQ_MAX_FORWARDS = 22; 138 public static final int REQ_PROXY_AUTHENTICATION = 23; 139 public static final int REQ_RANGE = 24; 140 public static final int REQ_REFERER = 25; 141 public static final int REQ_TE = 26; 142 public static final int REQ_USER_AGENT = 27; 143 public static final int REQ_KEEP_ALIVE = 28; 144 public static final int REQ_ALLOW = 29; 145 public static final int REQ_CONTENT_ENCODING = 30; 146 public static final int REQ_CONTENT_LANGUAGE = 31; 147 public static final int REQ_CONTENT_LENGTH = 32; 148 public static final int REQ_CONTENT_LOCATION = 33; 149 public static final int REQ_CONTENT_MD5 = 34; 150 public static final int REQ_CONTENT_RANGE = 35; 151 public static final int REQ_CONTENT_TYPE = 36; 152 public static final int REQ_EXPIRES = 37; 153 public static final int REQ_LAST_MODIFIED = 38; 154 public static final int REQ_LOCATION = 39; 155 public static final int REQ_SERVER = 40; 156 157 } 158