title: Increasing maxContentLength and maxBodyLength in Axios
body: <p>I am using &quot;Axios&quot; to call a WCF method that takes as parameter file information and content.
  The file is read and sent as a base64 encoded string.
  My issue is that when the file size exceeds a certain limit, AXIOS throws an exception: &quot;Error: Request body larger than maxBodyLength limit&quot;.
  I looked up the issue and found that all solutions suggest increasing the maxContentLength / maxBodyLength parameters in the AXIOS configuration object, but did not succeed.
  Find Below an implemented test case in node.js:</p>
  <pre><code>    var axios = require('axios');
      var fs = require('fs');
      var path = require('path')
      var util = require('util')
      let readfile = util.promisify(fs.readFile)
  
      async function sendData(url,data) {
          let params = data
      
          let resp = await axios({
              method: 'post',
              url: url,
              data: JSON.stringify(params),
              headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }
              // maxContentLength: 100000000,
              // maxBodyLength: 1000000000
          }).catch(err =&gt; {
              throw err;
          })
          return resp;
        }
      async function ReadFile(filepath) {
          try{
              
              let res = await readfile(filepath,'base64')
              let filename = path.basename(filepath).split('.').slice(0, -1).join('.')
              let ext = path.extname(filepath)
              
              return {data:res,fext:ext,fname:filename}
              let x = 1
          }
          catch(err)
          {
              throw err
          }
      
      }
      (async () =&gt; {
          try {
      
              let img = await ReadFile('Files/1.pdf')
              let res = await sendData('http://183.183.183.242/EMREngineEA/EMRWS.svc/web/EMR_TestUploadImg',img)
              console.log(res)
      
          }
          catch (ex) {
              console.log(ex)
          }
      }
      )();
  </code></pre>
  <p>In my case, the pdf file is 20 MB, upon running, an error is thrown.
  &quot;Error: Request body larger than maxBodyLength limit&quot;</p>
  <p>I tried to setting the   maxContentLength: 100000000, maxBodyLength: 1000000000
  as presented above, but did not succeed.</p>
  <p>Your help is appreciated.</p>