99
1010- [x] 语言
1111- [x] 程序运行方式
12- - [ ] 功能点
13- - [ ] 说明、运行截图
12+ - [x ] 功能点
13+ - [x ] 说明、运行截图
1414- [ ] 关键数据结构、类说明
1515 - [ ] 名字与对应功能
1616
@@ -204,19 +204,18 @@ CLIENT: Request complete
204204
205205# 3. 功能
206206
207- ## 3.1 HttpServer
207+ HttpServer 与 HttpClient 均采用 Java NIO.2 模型进行开发,使用了 ` java.nio.channels.AsynchronousServerSocketChannel ` 、 ` java.nio.channels.AsynchronousSocketChannel ` 等类。
208208
209- HttpServer 采用 Java NIO.2 模型进行开发,使用了 ` java.nio.channels.AsynchronousServerSocketChannel ` 、 ` java.nio.channels.AsynchronousSocketChannel ` 等类。
209+ ## 3.1 HttpServer
210210
211- ### 3.1.1 接收
212211
213- #### 3.1 .1.1 支持 ` GET ` 和 ` POST ` 请求
212+ ### 3 .1.1 支持 ` GET ` 和 ` POST ` 请求
214213
215214相关测试: [ LoginSystemTests] ( ./src/test/java/loginsystemtests/LoginSystemTests.java )
216215
217216<img src =" ./docs/image/feature_get.png " alt =" GET " width =" 300 " > <img src =" ./docs/image/feature_post.png " alt =" POST " width =" 300 " >
218217
219- #### 3.1 .1.2 支持以下状态码:
218+ ### 3 .1.2 支持以下状态码:
220219
221220- 200 OK<br />
222221<img src =" ./docs/image/feature_status_200.png " alt =" 200 " width =" 300 " >
@@ -242,12 +241,12 @@ HttpServer 采用 Java NIO.2 模型进行开发,使用了 `java.nio.channels.A
242241- 505 HTTP Version Not Supported<br />
243242<img src =" ./docs/image/feature_status_505.png " alt =" 505 " width =" 300 " >
244243
245- #### 3.1 .1.3 支持长连接 (Keep-Alive)
244+ ### 3 .1.3 支持长连接 (Keep-Alive)
246245
247246相关测试:[ KeepAliveTest] ( ./src/test/java/servertests/KeepAliveTest.java )
248247
249248<img src =" ./docs/image/feature_keep_alive.png " alt =" Keep-Alive " >
250- #### 3.1 .1.4 支持MIME类型:
249+ ### 3 .1.4 支持MIME类型:
251250
252251已测试过的全部类型: [ mime.json] ( ./src/main/resources/mime.json )
253252
@@ -265,7 +264,7 @@ HttpServer 采用 Java NIO.2 模型进行开发,使用了 `java.nio.channels.A
265264- svg: ` image/svg+xml ` <br />
266265<img src =" ./docs/image/feature_mime_svg.png " alt =" SVG " width =" 500 " >
267266
268- #### 3.1 .1.5 支持注册、登录、状态保持系统
267+ ### 3 .1.5 支持注册、登录、状态保持系统
269268
270269相关测试: [ LoginSystemTests] ( ./src/test/java/loginsystemtests/LoginSystemTests.java )
271270
@@ -285,3 +284,39 @@ HttpServer 采用 Java NIO.2 模型进行开发,使用了 `java.nio.channels.A
285284<img src =" ./docs/image/feature_loginsys_5.png " alt =" loginsys_5 " width =" 500 " >
286285
287286## 3.2 HttpClient
287+
288+ ### 3.2.1 在CLI界面显示 Http Request&Response Message
289+
290+ 相关测试:[ WANTest] ( ./src/test/java/clienttests/WANTest.java )
291+
292+ <img src =" ./docs/image/feature_client_cli.png " alt =" client_cli " >
293+
294+ ### 3.2.2 对 Status code 301, 302, 304 的处理
295+
296+ 相关测试:[ RequestTest] ( ./src/test/java/clienttests/RequestTest.java )
297+
298+ 1 . 301 Moved<br />
299+ <img src =" ./docs/image/feature_client_301.png " alt =" 301 " >
300+
301+ 2 . 302 Found<br />
302+ <img src =" ./docs/image/feature_client_302.png " alt =" 302 " >
303+
304+ 3 . 304 Not Modified<br />
305+ <img src =" ./docs/image/feature_client_304.png " alt =" 304 " >
306+
307+
308+ ### 3.3 其他
309+
310+ - 仅支持 HTTP/1.1
311+ - 收/发支持的 Content-Encoding: gzip
312+ - 收/发支持的 Transfer-Encoding: default(Content-Length), chunked
313+ - HttpServer 可以自动根据负载大小调整选用的 Content-Encoding 与 Transfer-Encoding
314+ - [ MessagePacker.java] ( ./src/main/java/edu/nju/http/message/packer/MessagePacker.java )
315+ - HttpServer 可以用类似 SpringBoot 的方式编写 URL Mapping
316+ - [ Target Handler] ( ./src/main/java/edu/nju/http/server/TargetHandler.java )
317+ - [ Mapping Annotation] ( ./src/main/java/edu/nju/http/server/target/Mapping.java )
318+ - [ target_path.json] ( ./src/main/resources/target_path.json )
319+ - [ Target Set] ( ./src/main/java/edu/nju/http/server/target/TargetSet.java )
320+
321+
322+ # 4. 源码结构
0 commit comments