• 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 request header constants of the HTTP protocol. See http://en.wikipedia.org/wiki/List_of_HTTP_header_fields.
20  * @author Daniel Holderbaum */
21 public interface HttpRequestHeader {
22 
23 	/** Content-Types that are acceptable for the response.
24 	 * <p>
25 	 * Example: Accept: text/plain */
26 	public static final String Accept = "Accept";
27 
28 	/** Character sets that are acceptable.
29 	 * <p>
30 	 * Example: Accept-Charset: utf-8 */
31 	public static final String AcceptCharset = "Accept-Charset";
32 
33 	/** List of acceptable encodings.
34 	 * <p>
35 	 * Example: Accept-Encoding: gzip, deflate */
36 	public static final String AcceptEncoding = "Accept-Encoding";
37 
38 	/** List of acceptable human languages for response.
39 	 * <p>
40 	 * Example: Accept-Language: en-US */
41 	public static final String AcceptLanguage = "Accept-Language";
42 
43 	/** Acceptable version in time.
44 	 * <p>
45 	 * Example: Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT */
46 	public static final String AcceptDatetime = "Accept-Datetime";
47 
48 	/** Authentication credentials for HTTP authentication.
49 	 * <p>
50 	 * Example: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== */
51 	public static final String Authorization = "Authorization";
52 
53 	/** Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.
54 	 * <p>
55 	 * Example: Cache-Control: no-cache */
56 	public static final String CacheControl = "Cache-Control";
57 
58 	/** What type of connection the user-agent would prefer.
59 	 * <p>
60 	 * Example: Connection: keep-alive */
61 	public static final String Connection = "Connection";
62 
63 	/** An HTTP cookie previously sent by the server with Set-Cookie (below).
64 	 * <p>
65 	 * Example: Cookie: $Version=1=""; Skin=new=""; */
66 	public static final String Cookie = "Cookie";
67 
68 	/** The length of the request body in octets (8-bit bytes).
69 	 * <p>
70 	 * Example: Content-Length: 348 */
71 	public static final String ContentLength = "Content-Length";
72 
73 	/** A Base64-encoded binary MD5 sum of the content of the request body.
74 	 * <p>
75 	 * Example: Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ== */
76 	public static final String ContentMD5 = "Content-MD5";
77 
78 	/** The MIME type of the body of the request (used with POST and PUT requests).
79 	 * <p>
80 	 * Example: Content-Type: application/x-www-form-urlencoded */
81 	public static final String ContentType = "Content-Type";
82 
83 	/** The date and time that the message was sent (in "HTTP-date" format as defined by RFC 7231).
84 	 * <p>
85 	 * Example: Date: Tue, 15 Nov 1994 08:12:31 GMT */
86 	public static final String Date = "Date";
87 
88 	/** Indicates that particular server behaviors are required by the client.
89 	 * <p>
90 	 * Example: Expect: 100-continue */
91 	public static final String Expect = "Expect";
92 
93 	/** The email address of the user making the request.
94 	 * <p>
95 	 * Example: From: user@example.com */
96 	public static final String From = "From";
97 
98 	/** The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The port
99 	 * number may be omitted if the port is the standard port for the service requested.
100 	 * <p>
101 	 * Example: en.wikipedia.org */
102 	public static final String Host = "Host";
103 
104 	/** Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for methods like
105 	 * PUT to only update a resource if it has not been modified since the user last updated it.
106 	 * <p>
107 	 * Example: If-Match: "737060cd8c284d8af7ad3082f209582d" */
108 	public static final String IfMatch = "If-Match";
109 
110 	/** Allows a 304 Not Modified to be returned if content is unchanged.
111 	 * <p>
112 	 * Example: If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT */
113 	public static final String IfModifiedSince = "If-Modified-Since";
114 
115 	/** Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag.
116 	 * <p>
117 	 * Example: If-None-Match: "737060cd8c284d8af7ad3082f209582d" */
118 	public static final String IfNoneMatch = "If-None-Match";
119 
120 	/** If the entity is unchanged, send me the part(s) that I am missing=""; otherwise, send me the entire new entity.
121 	 * <p>
122 	 * Example: If-Range: "737060cd8c284d8af7ad3082f209582d" */
123 	public static final String IfRange = "If-Range";
124 
125 	/** Only send the response if the entity has not been modified since a specific time.
126 	 * <p>
127 	 * Example: If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT */
128 	public static final String IfUnmodifiedSince = "If-Unmodified-Since";
129 
130 	/** Limit the number of times the message can be forwarded through proxies or gateways.
131 	 * <p>
132 	 * Example: Max-Forwards: 10 */
133 	public static final String MaxForwards = "Max-Forwards";
134 
135 	/** Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response field).
136 	 * <p>
137 	 * Example: Origin: http://www.example-social-network.com */
138 	public static final String Origin = "Origin";
139 
140 	/** Implementation-specific fields that may have various effects anywhere along the request-response chain.
141 	 * <p>
142 	 * Example: Pragma: no-cache */
143 	public static final String Pragma = "Pragma";
144 
145 	/** Authorization credentials for connecting to a proxy.
146 	 * <p>
147 	 * Example: Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== */
148 	public static final String ProxyAuthorization = "Proxy-Authorization";
149 
150 	/** Request only part of an entity. Bytes are numbered from 0.
151 	 * <p>
152 	 * Example: Range: bytes=500-999 */
153 	public static final String Range = "Range";
154 
155 	/** This is the address of the previous web page from which a link to the currently requested page was followed. (The word
156 	 * "referrer" has been misspelled in the RFC as well as in most implementations to the point that it has become standard usage
157 	 * and is considered correct terminology).
158 	 * <p>
159 	 * Example: Referer: http://en.wikipedia.org/wiki/Main_Page */
160 	public static final String Referer = "Referer";
161 
162 	/** The transfer encodings the user agent is willing to accept: the same values as for the response header field
163 	 * Transfer-Encoding can be used, plus the "trailers" value (related to the "chunked" transfer method) to notify the server it
164 	 * expects to receive additional fields in the trailer after the last, zero-sized, chunk.
165 	 * <p>
166 	 * Example: TE: trailers, deflate */
167 	public static final String TE = "TE";
168 
169 	/** The user agent string of the user agent.
170 	 * <p>
171 	 * Example: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/21.0 */
172 	public static final String UserAgent = "User-Agent";
173 
174 	/** Ask the server to upgrade to another protocol.
175 	 * <p>
176 	 * Example: Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 */
177 	public static final String Upgrade = "Upgrade";
178 
179 	/** Informs the server of proxies through which the request was sent.
180 	 * <p>
181 	 * Example: Via: 1.0 fred, 1.1 example.com (Apache/1.1) */
182 	public static final String Via = "Via";
183 
184 	/** A general warning about possible problems with the entity body.
185 	 * <p>
186 	 * Example: Warning: 199 Miscellaneous warning */
187 	public static final String Warning = "Warning";
188 
189 }
190