#Parse Request Body

37 messages · Page 1 of 1 (latest)

abstract smelt
#

Parse Request Body

simple oasis
#

whats ur code looking like

abstract smelt
#

im just trying to send the body back to test it rn

simple oasis
#

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

abstract smelt
#

removing the stringify didnt work

simple oasis
#

are u using nextjs13

abstract smelt
#

is it somthing with my post request on the client

simple oasis
#

what error are u getting

abstract smelt
abstract smelt
simple oasis
#

your not getting any errors?

abstract smelt
#

nope

simple oasis
#

whats ur api code looking like rn

#

and where r u calling this too

abstract smelt
#

this is the api code

abstract smelt
simple oasis
#

did u try console logging the api data

abstract smelt
#

in the api file ?

simple oasis
#

yeah

abstract smelt
#

it says undefined

simple oasis
#

oh wait

#

where the heck are you getting data from?

#

your not even sending anything named data

#

in ur json

abstract smelt
#

😂 ah i c, that fixed the problem

simple oasis
#

lmao

#

gg

abstract smelt
#

thank you for the help

simple oasis
#

yw

abstract smelt
#

do i close this forum now or ? im new to the server

simple oasis
#

you can yeah