• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*******************************************************************************
2  * Copyright 2011 See AUTHORS file.
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 com.badlogic.gdx.net;
18 
19 /** A list of common response header constants of the HTTP protocol. See http://en.wikipedia.org/wiki/List_of_HTTP_header_fields.
20  * @author Daniel Holderbaum */
21 public interface HttpResponseHeader {
22 	/** Specifying which web sites can participate in cross-origin resource sharing.
23 	 * <p>
24 	 * Example: Access-Control-Allow-Origin: * */
25 	public static final String AccessControlAllowOrigin = "Access-Control-Allow-Origin";
26 
27 	/** What partial content range types this server supports.
28 	 * <p>
29 	 * Example: Accept-Ranges: bytes */
30 	public static final String AcceptRanges = "Accept-Ranges";
31 
32 	/** The age the object has been in a proxy cache in seconds.
33 	 * <p>
34 	 * Example: Age: 12 */
35 	public static final String Age = "Age";
36 
37 	/** Valid actions for a specified resource. To be used for a 405 Method not allowed.
38 	 * <p>
39 	 * Example: Allow: GET, HEAD */
40 	public static final String Allow = "Allow";
41 
42 	/** Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds.
43 	 * <p>
44 	 * Example: Cache-Control: max-age=3600 */
45 	public static final String CacheControl = "Cache-Control";
46 
47 	/** Options that are desired for the connection.
48 	 * <p>
49 	 * Example: Connection: close */
50 	public static final String Connection = "Connection";
51 
52 	/** The type of encoding used on the data. See HTTP compression.
53 	 * <p>
54 	 * Example: Content-Encoding: gzip */
55 	public static final String ContentEncoding = "Content-Encoding";
56 
57 	/** The language the content is in.
58 	 * <p>
59 	 * Example: Content-Language: da */
60 	public static final String ContentLanguage = "Content-Language";
61 
62 	/** The length of the response body in octets (8-bit bytes).
63 	 * <p>
64 	 * Example: Content-Length: 348 */
65 	public static final String ContentLength = "Content-Length";
66 
67 	/** An alternate location for the returned data.
68 	 * <p>
69 	 * Example: Content-Location: /index.htm */
70 	public static final String ContentLocation = "Content-Location";
71 
72 	/** A Base64-encoded binary MD5 sum of the content of the response.
73 	 * <p>
74 	 * Example: Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ== */
75 	public static final String ContentMD5 = "Content-MD5";
76 
77 	/** An opportunity to raise a "File Download" dialogue box for a known MIME type with binary format or suggest a filename for
78 	 * dynamic content. Quotes are necessary with special characters.
79 	 * <p>
80 	 * Example: Content-Disposition: attachment; filename="fname.ext" */
81 	public static final String ContentDisposition = "Content-Disposition";
82 
83 	/** Where in a full body message this partial message belongs.
84 	 * <p>
85 	 * Example: Content-Range: bytes 21010-47021/47022 */
86 	public static final String ContentRange = "Content-Range";
87 
88 	/** The MIME type of this content.
89 	 * <p>
90 	 * Example: Content-Type: text/html; charset=utf-8 */
91 	public static final String ContentType = "Content-Type";
92 
93 	/** The date and time that the message was sent (in "HTTP-date" format as defined by RFC 7231).
94 	 * <p>
95 	 * Example: Date: Tue, 15 Nov 1994 08:12:31 GMT */
96 	public static final String Date = "Date";
97 
98 	/** An identifier for a specific version of a resource, often a message digest.
99 	 * <p>
100 	 * Example: ETag: "737060cd8c284d8af7ad3082f209582d" */
101 	public static final String ETag = "ETag";
102 
103 	/** Gives the date/time after which the response is considered stale.
104 	 * <p>
105 	 * Example: Expires: Thu, 01 Dec 1994 16:00:00 GMT */
106 	public static final String Expires = "Expires";
107 
108 	/** The last modified date for the requested object (in "HTTP-date" format as defined by RFC 7231).
109 	 * <p>
110 	 * Example: Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT */
111 	public static final String LastModified = "Last-Modified";
112 
113 	/** Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988.
114 	 * <p>
115 	 * Example: Link: </feed>; rel="alternate" */
116 	public static final String Link = "Link";
117 
118 	/** Used in redirection, or when a new resource has been created.
119 	 * <p>
120 	 * Example: Location: http://www.w3.org/pub/WWW/People.html */
121 	public static final String Location = "Location";
122 
123 	/** This field is supposed to set P3P policy, in the form of P3P:CP="your_compact_policy". However, P3P did not take off, most
124 	 * browsers have never fully implemented it, a lot of websites set this field with fake policy text, that was enough to fool
125 	 * browsers the existence of P3P policy and grant permissions for third party cookies.
126 	 * <p>
127 	 * Example: P3P: CP=
128 	 * "This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info." */
129 	public static final String P3P = "P3P";
130 
131 	/** Implementation-specific fields that may have various effects anywhere along the request-response chain.
132 	 * <p>
133 	 * Example: Pragma: no-cache */
134 	public static final String Pragma = "Pragma";
135 
136 	/** Request authentication to access the proxy.
137 	 * <p>
138 	 * Example: Proxy-Authenticate: Basic */
139 	public static final String ProxyAuthenticate = "Proxy-Authenticate";
140 
141 	/** Used in redirection, or when a new resource has been created. This refresh redirects after 5 seconds.
142 	 * <p>
143 	 * Example: Refresh: 5; url=http://www.w3.org/pub/WWW/People.html */
144 	public static final String Refresh = "Refresh";
145 
146 	/** If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of
147 	 * time (in seconds) or a HTTP-date.
148 	 * <p>
149 	 * Example: Example 1: Retry-After: 120Example 2: Retry-After: Fri, 07 Nov 2014 23:59:59 GMT */
150 	public static final String RetryAfter = "Retry-After";
151 
152 	/** A name for the server.
153 	 * <p>
154 	 * Example: Server: Apache/2.4.1 (Unix) */
155 	public static final String Server = "Server";
156 
157 	/** An HTTP cookie.
158 	 * <p>
159 	 * Example: Set-Cookie: UserID=JohnDoe; Max-Age=3600; Version=1 */
160 	public static final String SetCookie = "Set-Cookie";
161 
162 	/** CGI header field specifying the status of the HTTP response. Normal HTTP responses use a separate "Status-Line" instead,
163 	 * defined by RFC 7230.
164 	 * <p>
165 	 * Example: Status: 200 OK */
166 	public static final String Status = "Status";
167 
168 	/** A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains.
169 	 * <p>
170 	 * Example: Strict-Transport-Security: max-age=16070400; includeSubDomains */
171 	public static final String StrictTransportSecurity = "Strict-Transport-Security";
172 
173 	/** The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded
174 	 * with chunked transfer coding.
175 	 * <p>
176 	 * Example: Trailer: Max-Forwards */
177 	public static final String Trailer = "Trailer";
178 
179 	/** The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress,
180 	 * deflate, gzip, identity.
181 	 * <p>
182 	 * Example: Transfer-Encoding: chunked */
183 	public static final String TransferEncoding = "Transfer-Encoding";
184 
185 	/** Ask the client to upgrade to another protocol.
186 	 * <p>
187 	 * Example: Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 */
188 	public static final String Upgrade = "Upgrade";
189 
190 	/** Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than
191 	 * requesting a fresh one from the origin server.
192 	 * <p>
193 	 * Example: Vary: * */
194 	public static final String Vary = "Vary";
195 
196 	/** Informs the client of proxies through which the response was sent.
197 	 * <p>
198 	 * Example: Via: 1.0 fred, 1.1 example.com (Apache/1.1) */
199 	public static final String Via = "Via";
200 
201 	/** A general warning about possible problems with the entity body.
202 	 * <p>
203 	 * Example: Warning: 199 Miscellaneous warning */
204 	public static final String Warning = "Warning";
205 
206 	/** Indicates the authentication scheme that should be used to access the requested entity.
207 	 * <p>
208 	 * Example: WWW-Authenticate: Basic */
209 	public static final String WWWAuthenticate = "WWW-Authenticate";
210 }
211