readChunkedBody
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package org.redkale.test.http;
|
||||
|
||||
import org.redkale.net.http.RestBody;
|
||||
import org.redkale.net.http.RestService;
|
||||
import org.redkale.service.AbstractService;
|
||||
import org.redkale.util.Utility;
|
||||
@@ -33,4 +34,9 @@ public class RestSleepService extends AbstractService {
|
||||
Utility.sleep(500);
|
||||
return "ok500";
|
||||
}
|
||||
|
||||
public String sleepName(@RestBody String name) {
|
||||
System.out.println("获取到的名字: " + name);
|
||||
return "sleep: " + name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,18 @@ public class RestSleepTest {
|
||||
+ "GET /test/sleep500 HTTP/1.1\r\n"
|
||||
+ "Connection: Keep-Alive\r\n"
|
||||
+ "Content-Length: 0\r\n"
|
||||
+ "\r\n"
|
||||
+ "GET /test/sleepName HTTP/1.1\r\n"
|
||||
+ "Connection: Keep-Alive\r\n"
|
||||
+ "Transfer-Encoding: chunked\r\n"
|
||||
+ "\r\n"
|
||||
+ "4\r\n"
|
||||
+ "this\r\n"
|
||||
+ "6\r\n"
|
||||
+ " is a \r\n"
|
||||
+ "5\r\n"
|
||||
+ "name!\r\n"
|
||||
+ "0\r\n"
|
||||
+ "\r\n")
|
||||
.getBytes());
|
||||
InputStream in = socket.getInputStream();
|
||||
|
||||
Reference in New Issue
Block a user