title: How to show progress of Axios during get request (not download or upload)
body: <p>I want is to show a progressbar while Axios is getting my requests. <code>axios</code> package has both <code>onDownloadProgress</code> and <code>onUploadProgress</code> to show a progressbar during download or upload, but no progress bar during get request. I've searched a lot of questions and articles but they are always about download/upload progress or for Vue.js and I fail to understand how to do it in React.<br/><br/>I have the following code down below (which will not work because I'm not downloading).<br /><br />Ideally, I'd write it myself; but I'm willing to consider using <a href="https://www.npmjs.com/package/axios-progress-bar" rel="noreferrer">axios-progress package</a> if someone could explain me how I'd integrate the <code>loadProgressBar()</code> with my Axios request.</p>
  
  <pre><code>request = () =&gt; {
      this.setState({error: null, results: []})
      axios({
          method: 'get',
          url: process.env.REACT_APP_API_LOCALS,
          responseType: 'json',
          onDownloadProgress: (progressEvent) =&gt; {
              var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
              this.setState({
                  loading: percentCompleted
              })
          },
      })
      .then(
          (response) =&gt; {
              console.log(response)
              this.setState({
                  results: response.data.results,
                  error: null,
                  totalPages: Math.ceil(response.data.count / response.data.results.length)
              })  
          }
      )
      .catch(
          (error) =&gt; {
              this.setState({
                  loading: null,
                  error: true
              })  
          }
      );
  }
  </code></pre>