I have converted a image to base64 that are in my react.js application register form. It covert this image and send it to Node.js server with MySQL database. In here axios
post request is not is unsuccessful because converted url is very large.
frontend console shows net::ERR_FAILED 431 (Request Header Fields Too Large). Is there any way to handle this
2
Answers
Nodejs, by default, has a smaller limit for request body, which is what you seem to be running into. The limit can be increased using code snippet below in nodejs while initializing the body parser package
You can read more on the defaults and other settings here
Instead of sending the image data as base64, you can upload the image file directly to the server if you don’t want resize it.