How can I get the raw request body in a Google Cloud Function?
Unfortunately the default middleware currently provides no way to get the raw request body. See: Access to unparsed JSON body in HTTP Functions (#36252545).
Now you can get the raw body from req.rawBody
. It returns Buffer
. See documentation for more details.
Thanks to Nobuhito Kurose for posting this in comments.