File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
- export async function onRequest ( request ) {
1
+ export async function onRequest ( context ) {
2
+ console . log ( 'json' , await context . request . json ( ) )
3
+
2
4
const data = {
3
5
hello : 'world' ,
4
6
} ;
@@ -7,7 +9,7 @@ export async function onRequest(request) {
7
9
8
10
return new Response ( json , {
9
11
headers : {
10
- " content-type" : " application/json;charset=UTF-8" ,
12
+ ' content-type' : ' application/json;charset=UTF-8' ,
11
13
} ,
12
14
} ) ;
13
15
}
Original file line number Diff line number Diff line change @@ -20,10 +20,9 @@ const share = () => {
20
20
headers: {
21
21
' Content-Type' : ' application/json'
22
22
},
23
- body: ' {}'
24
- // JSON.stringify({
25
- // content: content.value
26
- // })
23
+ body: JSON .stringify ({
24
+ content: content .value
25
+ })
27
26
}).then (res => res .json ()).then (res => {
28
27
console .log (res )
29
28
contentChanged .value = true
You can’t perform that action at this time.
0 commit comments