Skip to content

Commit 621634f

Browse files
committed
post not done
1 parent 0ec7c7c commit 621634f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import { headers } from "next/headers";
22

3+
import { NextRequest } from "next/server";
4+
35
export async function GET() {
46
// Note: we use headers just so that the route is not built as a static one
57
const headersList = headers();
68
const sayHi = !!headersList.get("should-say-hi");
79
return new Response(sayHi ? "Hi World!" : "Hello World!");
810
}
911

10-
export async function POST(request: Request) {
11-
return new Response(`Hello post-World! body=${await request.text()}`);
12+
export async function POST(request: NextRequest) {
13+
console.log("Before text");
14+
const text = await request.text();
15+
console.log(`text is ${JSON.stringify(text)}`);
16+
console.log("After text");
17+
18+
return new Response(`Hello post-World! body=${text}`);
1219
}

0 commit comments

Comments
 (0)