Error: Request body larger than maxBodyLength limit when sending base64 post request Axios

You are setting

'maxContentLength': Infinity,
'maxBodyLength': Infinity

In your data object. It should be inside the config object, outside the data object.


That is what worked for me:

axios({
    method: 'post',
    url: posturl,
    data: formData,
    maxContentLength: Infinity,
    maxBodyLength: Infinity,
    headers: {'Content-Type': 'multipart/form-data;boundary=' + formData.getBoundary()}
})

Tags:

Node.Js

Axios