Node.js HTTP Get URL Length limitation

前端 未结 2 1982
情深已故
情深已故 2021-01-03 22:07

Is there a limit to the size when making HTTP GET requests in Node.js? And if so, how can I change this?

var url = \"...\" // very long, ~50\'000 chars
http.         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-03 22:46

    UPDATE

    In newer versions of NodeJS (v12.6.0+), the header request size limit is 8kb by default, and this also impacts the response header size. To use header sizes above 8KB, you can use the switch --max-http-header-size 65535 (or whatever size you need). This is described in-depth here.

提交回复
热议问题