Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when sending lots of data in body #64

Open
leondroidgeeks opened this issue Aug 23, 2017 · 1 comment
Open

Error when sending lots of data in body #64

leondroidgeeks opened this issue Aug 23, 2017 · 1 comment

Comments

@leondroidgeeks
Copy link

When I make a post request which contains a large body I get this error:

internal/child_process.js:319
    throw errnoException(err, 'spawn');
    ^

Error: spawn E2BIG
    at exports._errnoException (util.js:1050:11)
    at ChildProcess.spawn (internal/child_process.js:319:11)
    at Object.exports.spawn (child_process.js:378:9)
    at module.exports (/Users/Leon/Desktop/demo-repository/node_modules/curlrequest/spawn.js:19:30)
    at Object.exports.request (/Users/Leon/Desktop/demo-repository/node_modules/curlrequest/index.js:248:17)
    at Object.<anonymous> (/Users/Leon/Desktop/demo-repository/test.js:40:10)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

When I try to send a smaller file (smaller body) it works. When I send the request using Postman I works as well even with the large file.

@asankagit
Copy link

Its looks like same issue ....error occurs when uploading files more than 100kB

let options = {
        url: full_url,
        method: http_method,
        data: payload

    };  

postData as payload

let postData = {
      name: imageData.name,
      bytes: new Buffer(fileData).toString('base64').toString('utf8')
      
    };
Unhandled rejection Error: spawn E2BIG
    at _errnoException (util.js:1031:13)
    at ChildProcess.spawn (internal/child_process.js:340:11)
    at Object.exports.spawn (child_process.js:499:9)
    ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants