#Parse Request Body
37 messages · Page 1 of 1 (latest)
whats ur code looking like
im just trying to send the body back to test it rn
you don't need to stringify
the json data
res.json(data) is enough
thats what the json function for res does
now the input for req body
i think if not using application content
then u need to parse the body for input
removing the stringify didnt work
are u using nextjs13
is it somthing with my post request on the client
what error are u getting
yes
an empty object as the response
your not getting any errors?
nope
this is the api code
im calling it from a clientside component
did u try console logging the api data
in the api file ?
yeah
it says undefined
oh wait
where the heck are you getting data from?
your not even sending anything named data
in ur json
😂 ah i c, that fixed the problem
thank you for the help
yw
do i close this forum now or ? im new to the server
you can yeah