Mercurial Hosting > luan
annotate src/goodjava/webserver/Request.java @ 1669:fdeb1879fe02
manual work
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 10 May 2022 17:04:24 -0600 |
parents | fa066aaa068c |
children | a02a75e3daa8 |
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; | |
1607 | 6 import goodjava.util.CaseInsensitiveMap; |
1137 | 7 |
8 | |
9 public class Request { | |
10 public volatile String rawHead; | |
11 public volatile String method; | |
1143
3bf5190b3c77
webserver - handle GET params
Franklin Schmidt <fschmidt@gmail.com>
parents:
1137
diff
changeset
|
12 public volatile String rawPath; |
1371
4c5548a61d4f
add Request.originalPath
Franklin Schmidt <fschmidt@gmail.com>
parents:
1347
diff
changeset
|
13 public volatile String originalPath; |
1137 | 14 public volatile String path; |
15 public volatile String protocol; // only HTTP/1.1 is accepted | |
1237 | 16 public volatile String scheme; |
1607 | 17 public final Map<String,Object> headers = Collections.synchronizedMap(new CaseInsensitiveMap<Object>(new LinkedHashMap<String,CaseInsensitiveMap.Value<Object>>())); |
1137 | 18 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
|
19 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
|
20 public volatile byte[] body; |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
21 |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
22 public static final class MultipartFile { |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
23 public final String filename; |
1259
e8020216dee7
add Luan.to_luan and fix multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1237
diff
changeset
|
24 public final String contentType; |
1147
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
25 public final Object content; // byte[] or String |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
26 |
1274
383f924dfe9d
support multipart files in http request
Franklin Schmidt <fschmidt@gmail.com>
parents:
1259
diff
changeset
|
27 public MultipartFile(String filename,String contentType,Object content) { |
1147
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
28 this.filename = filename; |
1259
e8020216dee7
add Luan.to_luan and fix multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1237
diff
changeset
|
29 this.contentType = contentType; |
1147
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
30 this.content = content; |
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 |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
33 public String toString() { |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
34 return "{filename="+filename+", content="+content+"}"; |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
35 } |
30d87b7d1d62
webserver - support multipart/form-data
Franklin Schmidt <fschmidt@gmail.com>
parents:
1146
diff
changeset
|
36 } |
1137 | 37 } |