title: Check Axios request url before sending
body: <p>API requests are failing because the URL generated by Axios is incorrect due to my config. I know what the request url is suppose to look like, so I want to see the request url Axios generates.</p>
  
  <p>I can point Axios to my local server and see the requests there, but I want to debug this on the client. I want to play with the config, and see how the requests change. Is there a way to output the request url from Axios before or after sending?</p>
  
  <pre><code>// param format
  { address: 'Vancouver', key: GOOGLE_API_KEY }
  
  // Geocode sample
  https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&amp;key=YOUR_API_KEY
  
  _request = async (...args) =&gt; {
    const { outputFormat, params } = args
    const instance = axios.create({
      baseURL: `https://maps.googleapis.com`,
    })
  
    const response = await instance.get('/maps/api/geocode/${outputFormat}?', {
      params,
    })
  
    // I want to see the url generated by Axios so I can debug the issue
  
    console.log(response) 
  }
  </code></pre>
  
  <p>I am within the <code>Expo</code>, <code>React Native</code> environment.</p>
  
  <p>Working example using fetch:</p>
  
  <pre><code>const url = `https://maps.googleapis.com/maps/api/geocode/json?address=vancouver&amp;key=${GOOGLE_API_KEY}`
  
  fetch(url)
    .then((response) =&gt; response.json())
    .then((data) =&gt; {
      console.log(data)
    })
    .catch(function(error) {
      console.log(error)
    })
  </code></pre>
  
  <p><strong>Solution used:</strong></p>
  
  <pre><code>_request = async (obj) =&gt; {
    const { outputFormat, params } = obj
  
    const instance = axios.create({
      baseURL: `https://maps.googleapis.com`,
    })
  
    instance.interceptors.request.use(function (config) {
      console.log(config)
      return config
    }, function (error) {
      return Promise.reject(error)
    })
  
    const response = await instance.get(`/maps/api/geocode/${outputFormat}`, {
      params,
    })
  }
  </code></pre>