We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec40df0 commit ed45ea0Copy full SHA for ed45ea0
1 file changed
coverage-report/src/test/java/org/jooby/ByteBodyFeature.java
@@ -0,0 +1,23 @@
1
+package org.jooby;
2
+
3
+import java.nio.charset.StandardCharsets;
4
5
+import org.jooby.test.ServerFeature;
6
+import org.junit.Test;
7
8
+public class ByteBodyFeature extends ServerFeature {
9
10
+ {
11
+ post("/bytes", req -> {
12
+ return new String(req.body(byte[].class), StandardCharsets.UTF_8);
13
+ });
14
+ }
15
16
+ @Test
17
+ public void shouldReadBodyAsByteArray() throws Exception {
18
+ request()
19
+ .post("/bytes")
20
+ .body("foo", "text/plain")
21
+ .expect("foo");
22
23
+}
0 commit comments