|
53 | 53 | * <p>Inspired by {@link com.sun.net.httpserver.Headers}.
|
54 | 54 | *
|
55 | 55 | * @author Arjen Poutsma
|
| 56 | + * @author Sebastien Deleuze |
56 | 57 | * @since 3.0
|
57 | 58 | */
|
58 | 59 | public class HttpHeaders implements MultiValueMap<String, String>, Serializable {
|
59 | 60 |
|
60 | 61 | private static final long serialVersionUID = -8578554704772377436L;
|
61 | 62 |
|
| 63 | + /** |
| 64 | + * The HTTP {@code Accept} header field name. |
| 65 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.3.2">Section 5.3.2 of RFC 7231</a> |
| 66 | + */ |
62 | 67 | public static final String ACCEPT = "Accept";
|
63 |
| - |
| 68 | + /** |
| 69 | + * The HTTP {@code Accept-Charset} header field name. |
| 70 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.3.3">Section 5.3.3 of RFC 7231</a> |
| 71 | + */ |
64 | 72 | public static final String ACCEPT_CHARSET = "Accept-Charset";
|
65 |
| - |
| 73 | + /** |
| 74 | + * The HTTP {@code Accept-Encoding} header field name. |
| 75 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.3.4">Section 5.3.4 of RFC 7231</a> |
| 76 | + */ |
| 77 | + public static final String ACCEPT_ENCODING = "Accept-Encoding"; |
| 78 | + /** |
| 79 | + * The HTTP {@code Accept-Language} header field name. |
| 80 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.3.5">Section 5.3.5 of RFC 7231</a> |
| 81 | + */ |
| 82 | + public static final String ACCEPT_LANGUAGE = "Accept-Language"; |
| 83 | + /** |
| 84 | + * The HTTP {@code Accept-Ranges} header field name. |
| 85 | + * @see <a href="http://tools.ietf.org/html/rfc7233#section-2.3">Section 5.3.5 of RFC 7233</a> |
| 86 | + */ |
| 87 | + public static final String ACCEPT_RANGES = "Accept-Ranges"; |
| 88 | + /** |
| 89 | + * The HTTP {@code Age} header field name. |
| 90 | + * @see <a href="http://tools.ietf.org/html/rfc7234#section-5.1">Section 5.1 of RFC 7234</a> |
| 91 | + */ |
| 92 | + public static final String AGE = "Age"; |
| 93 | + /** |
| 94 | + * The HTTP {@code Allow} header field name. |
| 95 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-7.4.1">Section 7.4.1 of RFC 7231</a> |
| 96 | + */ |
66 | 97 | public static final String ALLOW = "Allow";
|
67 |
| - |
| 98 | + /** |
| 99 | + * The HTTP {@code Authorization} header field name. |
| 100 | + * @see <a href="http://tools.ietf.org/html/rfc7235#section-4.2">Section 4.2 of RFC 7235</a> |
| 101 | + */ |
| 102 | + public static final String AUTHORIZATION = "Authorization"; |
| 103 | + /** |
| 104 | + * The HTTP {@code Cache-Control} header field name. |
| 105 | + * @see <a href="http://tools.ietf.org/html/rfc7234#section-5.2">Section 5.2 of RFC 7234</a> |
| 106 | + */ |
68 | 107 | public static final String CACHE_CONTROL = "Cache-Control";
|
69 |
| - |
| 108 | + /** |
| 109 | + * The HTTP {@code Connection} header field name. |
| 110 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-6.1">Section 6.1 of RFC 7230</a> |
| 111 | + */ |
70 | 112 | public static final String CONNECTION = "Connection";
|
71 |
| - |
| 113 | + /** |
| 114 | + * The HTTP {@code Content-Encoding} header field name. |
| 115 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-3.1.2.2">Section 3.1.2.2 of RFC 7231</a> |
| 116 | + */ |
| 117 | + public static final String CONTENT_ENCODING = "Content-Encoding"; |
| 118 | + /** |
| 119 | + * The HTTP {@code Content-Disposition} header field name |
| 120 | + * @see <a href="http://tools.ietf.org/html/rfc6266">RFC 6266</a> |
| 121 | + */ |
72 | 122 | public static final String CONTENT_DISPOSITION = "Content-Disposition";
|
73 |
| - |
| 123 | + /** |
| 124 | + * The HTTP {@code Content-Language} header field name. |
| 125 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-3.1.3.2">Section 3.1.3.2 of RFC 7231</a> |
| 126 | + */ |
| 127 | + public static final String CONTENT_LANGUAGE = "Content-Language"; |
| 128 | + /** |
| 129 | + * The HTTP {@code Content-Length} header field name. |
| 130 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-3.3.2">Section 3.3.2 of RFC 7230</a> |
| 131 | + */ |
74 | 132 | public static final String CONTENT_LENGTH = "Content-Length";
|
75 |
| - |
| 133 | + /** |
| 134 | + * The HTTP {@code Content-Location} header field name. |
| 135 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-3.1.4.2">Section 3.1.4.2 of RFC 7231</a> |
| 136 | + */ |
| 137 | + public static final String CONTENT_LOCATION = "Content-Location"; |
| 138 | + /** |
| 139 | + * The HTTP {@code Content-Range} header field name. |
| 140 | + * @see <a href="http://tools.ietf.org/html/rfc7233#section-4.2">Section 4.2 of RFC 7233</a> |
| 141 | + */ |
| 142 | + public static final String CONTENT_RANGE = "Content-Range"; |
| 143 | + /** |
| 144 | + * The HTTP {@code Content-Type} header field name. |
| 145 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-3.1.1.5">Section 3.1.1.5 of RFC 7231</a> |
| 146 | + */ |
76 | 147 | public static final String CONTENT_TYPE = "Content-Type";
|
77 |
| - |
| 148 | + /** |
| 149 | + * The HTTP {@code Cookie} header field name. |
| 150 | + * @see <a href="http://tools.ietf.org/html/rfc2109#section-4.3.4">Section 4.3.4 of RFC 2109</a> |
| 151 | + */ |
| 152 | + public static final String COOKIE = "Cookie"; |
| 153 | + /** |
| 154 | + * The HTTP {@code Date} header field name. |
| 155 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-7.1.1.2">Section 7.1.1.2 of RFC 7231</a> |
| 156 | + */ |
78 | 157 | public static final String DATE = "Date";
|
79 |
| - |
| 158 | + /** |
| 159 | + * The HTTP {@code ETag} header field name. |
| 160 | + * @see <a href="http://tools.ietf.org/html/rfc7232#section-2.3">Section 2.3 of RFC 7232</a> |
| 161 | + */ |
80 | 162 | public static final String ETAG = "ETag";
|
81 |
| - |
| 163 | + /** |
| 164 | + * The HTTP {@code Expect} header field name. |
| 165 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.1.1">Section 5.1.1 of RFC 7231</a> |
| 166 | + */ |
| 167 | + public static final String EXPECT = "Expect"; |
| 168 | + /** |
| 169 | + * The HTTP {@code Expires} header field name. |
| 170 | + * @see <a href="http://tools.ietf.org/html/rfc7234#section-5.3">Section 5.3 of RFC 7234</a> |
| 171 | + */ |
82 | 172 | public static final String EXPIRES = "Expires";
|
83 |
| - |
| 173 | + /** |
| 174 | + * The HTTP {@code From} header field name. |
| 175 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.5.1">Section 5.5.1 of RFC 7231</a> |
| 176 | + */ |
| 177 | + public static final String FROM = "From"; |
| 178 | + /** |
| 179 | + * The HTTP {@code Host} header field name. |
| 180 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-5.4">Section 5.4 of RFC 7230</a> |
| 181 | + */ |
| 182 | + public static final String HOST = "Host"; |
| 183 | + /** |
| 184 | + * The HTTP {@code If-Match} header field name. |
| 185 | + * @see <a href="http://tools.ietf.org/html/rfc7232#section-3.1">Section 3.1 of RFC 7232</a> |
| 186 | + */ |
| 187 | + public static final String IF_MATCH = "If-Match"; |
| 188 | + /** |
| 189 | + * The HTTP {@code If-Modified-Since} header field name. |
| 190 | + * @see <a href="http://tools.ietf.org/html/rfc7232#section-3.3">Section 3.3 of RFC 7232</a> |
| 191 | + */ |
84 | 192 | public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
|
85 |
| - |
| 193 | + /** |
| 194 | + * The HTTP {@code If-None-Match} header field name. |
| 195 | + * @see <a href="http://tools.ietf.org/html/rfc7232#section-3.2">Section 3.2 of RFC 7232</a> |
| 196 | + */ |
86 | 197 | public static final String IF_NONE_MATCH = "If-None-Match";
|
87 |
| - |
| 198 | + /** |
| 199 | + * The HTTP {@code If-Range} header field name. |
| 200 | + * @see <a href="http://tools.ietf.org/html/rfc7233#section-3.2">Section 3.2 of RFC 7233</a> |
| 201 | + */ |
| 202 | + public static final String IF_RANGE = "If-Range"; |
| 203 | + /** |
| 204 | + * The HTTP {@code If-Unmodified-Since} header field name. |
| 205 | + * @see <a href="http://tools.ietf.org/html/rfc7232#section-3.4">Section 3.4 of RFC 7232</a> |
| 206 | + */ |
| 207 | + public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; |
| 208 | + /** |
| 209 | + * The HTTP {@code Last-Modified} header field name. |
| 210 | + * @see <a href="http://tools.ietf.org/html/rfc7232#section-2.2">Section 2.2 of RFC 7232</a> |
| 211 | + */ |
88 | 212 | public static final String LAST_MODIFIED = "Last-Modified";
|
89 |
| - |
| 213 | + /** |
| 214 | + * The HTTP {@code Link} header field name. |
| 215 | + * @see <a href="http://tools.ietf.org/html/rfc5988">RFC 5988</a> |
| 216 | + */ |
| 217 | + public static final String LINK = "Link"; |
| 218 | + /** |
| 219 | + * The HTTP {@code Location} header field name. |
| 220 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-7.1.2">Section 7.1.2 of RFC 7231</a> |
| 221 | + */ |
90 | 222 | public static final String LOCATION = "Location";
|
91 |
| - |
| 223 | + /** |
| 224 | + * The HTTP {@code Max-Forwards} header field name. |
| 225 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.1.2">Section 5.1.2 of RFC 7231</a> |
| 226 | + */ |
| 227 | + public static final String MAX_FORWARDS = "Max-Forwards"; |
| 228 | + /** |
| 229 | + * The HTTP {@code Origin} header field name. |
| 230 | + * @see <a href="http://tools.ietf.org/html/rfc6454">RFC 6454</a> |
| 231 | + */ |
92 | 232 | public static final String ORIGIN = "Origin";
|
93 |
| - |
| 233 | + /** |
| 234 | + * The HTTP {@code Pragma} header field name. |
| 235 | + * @see <a href="http://tools.ietf.org/html/rfc7234#section-5.4">Section 5.4 of RFC 7234</a> |
| 236 | + */ |
94 | 237 | public static final String PRAGMA = "Pragma";
|
95 |
| - |
| 238 | + /** |
| 239 | + * The HTTP {@code Proxy-Authenticate} header field name. |
| 240 | + * @see <a href="http://tools.ietf.org/html/rfc7235#section-4.3">Section 4.3 of RFC 7235</a> |
| 241 | + */ |
| 242 | + public static final String PROXY_AUTHENTICATE = "Proxy-Authenticate"; |
| 243 | + /** |
| 244 | + * The HTTP {@code Proxy-Authorization} header field name. |
| 245 | + * @see <a href="http://tools.ietf.org/html/rfc7235#section-4.4">Section 4.4 of RFC 7235</a> |
| 246 | + */ |
| 247 | + public static final String PROXY_AUTHORIZATION = "Proxy-Authorization"; |
| 248 | + /** |
| 249 | + * The HTTP {@code Range} header field name. |
| 250 | + * @see <a href="http://tools.ietf.org/html/rfc7233#section-3.1">Section 3.1 of RFC 7233</a> |
| 251 | + */ |
| 252 | + public static final String RANGE = "Range"; |
| 253 | + /** |
| 254 | + * The HTTP {@code Referer} header field name. |
| 255 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.5.2">Section 5.5.2 of RFC 7231</a> |
| 256 | + */ |
| 257 | + public static final String REFERER = "Referer"; |
| 258 | + /** |
| 259 | + * The HTTP {@code Retry-After} header field name. |
| 260 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-7.1.3">Section 7.1.3 of RFC 7231</a> |
| 261 | + */ |
| 262 | + public static final String RETRY_AFTER = "Retry-After"; |
| 263 | + /** |
| 264 | + * The HTTP {@code Server} header field name. |
| 265 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-7.4.2">Section 7.4.2 of RFC 7231</a> |
| 266 | + */ |
| 267 | + public static final String SERVER = "Server"; |
| 268 | + /** |
| 269 | + * The HTTP {@code Set-Cookie} header field name. |
| 270 | + * @see <a href="http://tools.ietf.org/html/rfc2109#section-4.2.2">Section 4.2.2 of RFC 2109</a> |
| 271 | + */ |
| 272 | + public static final String SET_COOKIE = "Set-Cookie"; |
| 273 | + /** |
| 274 | + * The HTTP {@code Set-Cookie2} header field name. |
| 275 | + * @see <a href="http://tools.ietf.org/html/rfc2965">RFC 2965</a> |
| 276 | + */ |
| 277 | + public static final String SET_COOKIE2 = "Set-Cookie2"; |
| 278 | + /** |
| 279 | + * The HTTP {@code TE} header field name. |
| 280 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-4.3">Section 4.3 of RFC 7230</a> |
| 281 | + */ |
| 282 | + public static final String TE = "TE"; |
| 283 | + /** |
| 284 | + * The HTTP {@code Trailer} header field name. |
| 285 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-4.4">Section 4.4 of RFC 7230</a> |
| 286 | + */ |
| 287 | + public static final String TRAILER = "Trailer"; |
| 288 | + /** |
| 289 | + * The HTTP {@code Transfer-Encoding} header field name. |
| 290 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-3.3.1">Section 3.3.1 of RFC 7230</a> |
| 291 | + */ |
| 292 | + public static final String TRANSFER_ENCODING = "Transfer-Encoding"; |
| 293 | + /** |
| 294 | + * The HTTP {@code Upgrade} header field name. |
| 295 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-6.7">Section 6.7 of RFC 7230</a> |
| 296 | + */ |
96 | 297 | public static final String UPGRADE = "Upgrade";
|
97 |
| - |
| 298 | + /** |
| 299 | + * The HTTP {@code User-Agent} header field name. |
| 300 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-5.5.3">Section 5.5.3 of RFC 7231</a> |
| 301 | + */ |
| 302 | + public static final String USER_AGENT = "User-Agent"; |
| 303 | + /** |
| 304 | + * The HTTP {@code Vary} header field name. |
| 305 | + * @see <a href="http://tools.ietf.org/html/rfc7231#section-7.1.4">Section 7.1.4 of RFC 7231</a> |
| 306 | + */ |
| 307 | + public static final String VARY = "Vary"; |
| 308 | + /** |
| 309 | + * The HTTP {@code Via} header field name. |
| 310 | + * @see <a href="http://tools.ietf.org/html/rfc7230#section-5.7.1">Section 5.7.1 of RFC 7230</a> |
| 311 | + */ |
| 312 | + public static final String VIA = "Via"; |
| 313 | + /** |
| 314 | + * The HTTP {@code Warning} header field name. |
| 315 | + * @see <a href="http://tools.ietf.org/html/rfc7234#section-5.5">Section 5.5 of RFC 7234</a> |
| 316 | + */ |
| 317 | + public static final String WARNING = "Warning"; |
| 318 | + /** |
| 319 | + * The HTTP {@code WWW-Authenticate} header field name. |
| 320 | + * @see <a href="http://tools.ietf.org/html/rfc7235#section-4.1">Section 4.1 of RFC 7235</a> |
| 321 | + */ |
| 322 | + public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; |
98 | 323 |
|
99 | 324 | private static final String[] DATE_FORMATS = new String[] {
|
100 | 325 | "EEE, dd MMM yyyy HH:mm:ss zzz",
|
|
0 commit comments