You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the json parser as middleware in an express app, but for all requests (even with Content-Type: text/plain), the parser will set req.body to an empty object, so I can't use that to see if the request has a body. The json parser sets req.body before deciding to parse it. What's the best way to determine whether or not a request has a body when using this middleware?
The text was updated successfully, but these errors were encountered:
I use the json parser as middleware in an express app, but for all requests (even with
Content-Type: text/plain
), the parser will setreq.body
to an empty object, so I can't use that to see if the request has a body. The json parser setsreq.body
before deciding to parse it. What's the best way to determine whether or not a request has a body when using this middleware?The text was updated successfully, but these errors were encountered: