title: Failed to load resource: the server responded with a status of 431 (Request Header Fields Too Large)
body: <p>when i am trying to use my NodeJS api from the react app(building a MERN stack app) i get the error mentioned in question
  <strong>"Failed to load resource: the server responded with a status of 431 (Request Header Fields Too Large)"</strong></p>
  
  <p>the api is working fine from postman</p>
  
  <pre><code>const onSubmit=async(e)=&gt;{
      e.preventDefault()
      if(password!==password2){
          console.log('passwords dont match')
      }else{
          const newUser={
              name:name,
              email:email,
              password:password
          }
          try {
              const config={
                  headers:{
                      'Content-Type':'application/json'
                  }
              }
              const body=JSON.stringify(newUser)
  
              //axios has been set up as proxy
              //http://localhost:3000
              //we dont need to add the above to url
              const res =await axios.post('/api/users',body,config)
              console.log(res.data)
  
          } catch (error) {
              console.error(error.response.data)
          }
      }
  }
  </code></pre>