[Vuejs]-HTTP response truncated in browser

-5👍

Why the hell do you receive a 4MB reponse after posting data ?

Except this, if you are in nodeJS side, just write the content of the response to a debug file

const fse = require('fs-extra')

const postMyAwesomeData = async function () {
    try {
        const firstCall = await axios({ method: 'POST', url, data, headers });
        // if you need more of those calls
        const responses = Promise.all([firstCall]);

        // responses.forEach does not handle very well async/await ^^
        for (let [index, response] of responses.entries()) {
            await fse.write(`<path to debug file>/response${index}.txt`)
        }
    } catch (err) {
        console.log(`Hum something weird happen -_- ${err}`);
    }
}

Check out this awesome package https://www.npmjs.com/package/fs-extra

But honnestly, what’s the actual use case to retrieve such a big response after posting your data ?

👤veakey

Leave a comment