DEV Community

Owen Ross
Owen Ross

Posted on

How do i retrieve request body items in flask

Hello DEV Community,

Just wondering how to retrive attributes in a post request body in flask

Top comments (2)

Collapse
 
rensu1114 profile image
Ren •

It depends on how the client sends the payload. For JSON requests, request.get_json() is the usual way to access the body, while form submissions can be read with request.form. If you're still having trouble, sharing a sample payload and its Content-Type header would help narrow it down.

Collapse
 
dev2023-op profile image
Owen Ross •

Thanks, this helps alot