Mercurial Hosting > luan
annotate src/goodjava/webserver/Request.java @ 1489:fe237d72b234
improve BufferedInputStream
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 02 May 2020 16:28:24 -0600 |
parents | 27efb1fcbcb5 |
children | fa066aaa068c |
rev | line source |
---|---|
1402
27efb1fcbcb5
move luan.lib to goodjava
Franklin Schmidt <fschmidt@gmail.com>
parents:
1371
diff
changeset
|
1 package goodjava.webserver; |
1137 | 2 |
3 import java.util.Map; | |
4 import java.util.LinkedHashMap; | |
5 import java.util.Collections; | |
6 | |
7 | |
8 public class Request { | |
9 public volatile String rawHead; | |
10 public volatile String method; | |
1143
3bf5190b3c77
webserver - handle GET params
Franklin Schmidt <fschmidt@gmail.com>
parents:
1137
diff
changeset
|
11 public volatile String rawPath; |
1371
4c5548a61d4f
add Request.originalPath
Franklin Schmidt <fschmidt@gmail.com>
parents:
1347
diff
changeset
|
12 public volatile String originalPath; |
1137 | 13 public volatile String path; |
14 public volatile String protocol; // only HTTP/1.1 is accepted | |
1237 | 15 public volatile String scheme; |
1146
2dda3c92a473
webserver - implement cookies
Franklin Schmidt <fschmidt@gmail.com>
parents:
1144
diff
changeset
|
16 public final Map<String,Object> headers = Collections.synchronizedMap(new LinkedHashMap<String,Object>()); |
1137 | 17 public final Map<String,Object> parameters = Collections.synchronizedMap(new LinkedHashMap<String,Object>()); |
1146
2dda3c92a473
webserver - implement cookies
Franklin Schmidt <fschmidt@gmail.com>
parents:
1144
diff
changeset
|
18 public final Map<String,String> cookies = Collections.synchronizedMap(new LinkedHashMap<String,String>()); |
1147
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
19 public volatile byte[] body; |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
20 |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
21 public static final class MultipartFile { |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
22 public final String filename; |
1259
e8020216dee7
add Luan.to_luan and fix multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1237
diff
changeset
|
23 public final String contentType; |
1147
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
24 public final Object content; // byte[] or String |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
25 |
1274
383f924dfe9d
support multipart files in http request
Franklin Schmidt <fschmidt@gmail.com>
parents:
1259
diff
changeset
|
26 public MultipartFile(String filename,String contentType,Object content) { |
1147
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
27 this.filename = filename; |
1259
e8020216dee7
add Luan.to_luan and fix multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1237
diff
changeset
|
28 this.contentType = contentType; |
1147
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
29 this.content = content; |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
30 } |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
31 |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
32 public String toString() { |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
33 return "{filename="+filename+", content="+content+"}"; |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
34 } |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
35 } |
1137 | 36 } |