Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add HTTP body reader helper#1159

RatchetS2 started this conversation inIdeas
Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
1 participant
@RatchetS2

[8]ページ先頭

©2009-2025 Movatter.jp