how to post a huge javascript object
See original GitHub issueDescribe the issue When posting a large object through axios post method, the browser will crash
Example Code
// Example code here
// this object will be very large;
const data = {........};
// JSON.stringify(data).length will be 550000000 which means nearly 550MB!
axios.post('http://xxx.yy.com/api/', importData, {
headers: { 'content-type': 'application/json' },
}).then(msg => window.console.log('success:', msg))
.catch(err => window.console.log('error: ', err));
Expected behavior, if applicable A clear and concise description of what you expected to happen.
Environment:
- Axios Version 0.17.0
- OS: Win10
- Browser Chrome
- Browser Version 76
- Additional Library Versions React.16.8
Additional context/Screenshots chrome page will crash and showing this picture…
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
How upload large JSON object in javascript with form data?
I'm trying to upload a very large object that contains several arrays within which are more arrays. I tried to upload using FormData...
Read more >When You Should Prefer Map Over Object In JavaScript
In this post, I will break down all the reasons when you should consider using Map more and its performance characteristics with benchmarks....
Read more >What is an Object in JavaScript? - CodeBrainer
In this blog post, we explain: What is an Object in JavaScript; How to add methods to JavaScript objects; What is a constructor;...
Read more >How to send a JSON object to a server using Javascript?
In this example we are going to use AJAX (Asynchronous JavaScript And XML), to send data in background. We are using PHP for...
Read more >I have a large JSON object (~2GB), what's the best way to ...
I have a large JSON object file that was converted from a table. I programmed a website using HTML and JS that lets...
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
Are you sure, that is correct way to done task? Maybe would be correct way to do task in the background? Server -> server? sorry for eng
Maybe you can try web workers.
Anyway, it is not an issue of axios. We suggest users ask similar questions in stackoverflow. Good luck!