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
To parse the request body, we currently have to use the "onData" function.
While it provides full control over the receiving stream and works well for uploading or client-side streaming, it is overly complicated and less efficient for simpler requests such as form post or json api.
So i propose adding an "onFullData" function that automatically concatenates the received chunks and returns the complete body as an ArrayBuffer to Node.js. The performance benefits:
Only one call from c++ to Node.js
No buffer copying and concatenation on the Node.js side
Function signature could be: onFullData(maxSize: number, timeout: number, handler: (fullBody: ArrayBuffer) => void) : HttpResponse;
On timed out or max size exceeded, handler returns with the partial body.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
To parse the request body, we currently have to use the "onData" function.
While it provides full control over the receiving stream and works well for uploading or client-side streaming, it is overly complicated and less efficient for simpler requests such as form post or json api.
So i propose adding an "onFullData" function that automatically concatenates the received chunks and returns the complete body as an ArrayBuffer to Node.js. The performance benefits:
Function signature could be:
onFullData(maxSize: number, timeout: number, handler: (fullBody: ArrayBuffer) => void) : HttpResponse;
On timed out or max size exceeded, handler returns with the partial body.
Beta Was this translation helpful? Give feedback.
All reactions