There is no way to access request's raw body
See original GitHub issueI implement an integration with Stripe, and need access to request’s raw body in order to verify signature (Stripe makes POST requests on specified webhook). I have found that in the source code:
connection.rawConnection.form = new formidable.IncomingForm()
for (i in api.config.servers.web.formOptions) {
connection.rawConnection.form[i] = api.config.servers.web.formOptions[i]
}
connection.rawConnection.form.parse(connection.rawConnection.req, (error, fields, files) => {
if (error) {
server.log('error processing form: ' + String(error), 'error')
connection.error = new Error('There was an error processing this form.')
} else {
connection.rawConnection.params.body = fields
connection.rawConnection.params.files = files
fillParamsFromWebRequest(connection, files)
fillParamsFromWebRequest(connection, fields)
}
if (api.config.servers.web.queryRouting !== true) { connection.params.action = null }
api.routes.processRoute(connection, pathParts)
callback(requestMode)
})
As I understood, there is no way to access raw body via rawConnection
object. Is there any other way (maybe suggestions) how to access it?
- ActionHero Version:
16.0.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Retrieve the raw request body · Issue #2255 · nock/nock · GitHub
I thought there was a way to access the raw request body but cannot recall it right now. Can you check the tests...
Read more >How to get raw request body in ASP.NET? - Stack Overflow
InputStream is the answer. StreamReader.ReadToEnd should give you the string. If it is an empty string, that means there is no "body" in...
Read more >Solved: How to Specify a Raw Body on a Custom Connector in...
Solved: Hi, I'm creating a Flow process that uses a custom connector to access an on-prem API using the data gateway. I'm on...
Read more >Accepting Raw Request Body Content in ASP.NET Core API ...
When posting raw body content to ASP.NET Core the process is not very self-explanatory. There's no easy way to simply retrieve raw data...
Read more >Request and response objects - Django documentation
If you need to access raw or non-form data posted in the request, access this through the HttpRequest.body attribute instead. It's possible that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got it! Check out https://github.com/actionhero/actionhero/pull/1082… I think this would solve your problem?
closed by #1082