title: how to pass headers in the reactJs code and get api results in console
body: <p>I have made a search button and written the code as given below but I need to pass headers that are given below but am unable to fetch results. is this way of passing headers correct or do I need to change something.</p>
  <pre><code>import React, {useState, useEffect} from 'react'
  import axios from 'axios';
  import Navbar from &quot;./components/Navbar&quot;;
  
  
  export default function App() {
  
   const [searchText ,setSearchText]=useState(&quot;&quot;);
    
    
  
    useEffect(() =&gt; {
      console.log(searchText); ;
      }, [searchText]); 
      
  
    function searchForOrder(){
      var config = {
        method: 'get',
        url: `/api/orders-lookup/services/v4/orders?orderNo=${searchText}`,
        headers: { 
          'Accept': 'application/json', 
          'Content-Type': 'application/json', 
          'WM_CONSUMER.ID': '2d0a30c7-b4cc-45d1-b451-d93535f5a92d', 
          'WM_CONSUMER.TENANT_ID': '0', 
          'WM_SVC.ENV': 'teflon', 
          'WM_SVC.NAME': 'order-service', 
          'WM_SVC.VERSION': '4.0.0', 
          'X-Request-ID': '1234_3bb32b5d-32e9-4d0a-ace6-e682edddd348', 
          'WM_QOS.CORRELATION_ID': '1234'
        }
      };
      
      //set up correct api call
     
      console.log(config)
      //handle api call
      
      axios.get(config)
      .then((response)=&gt; {
        console.log(JSON.stringify(response.data));
      })
      .catch(function (error) {
        console.log(error);
      });
    }
  
  
    return (
      &lt;div className='fullscreen-container'&gt;
        &lt;div className='Navbar'&gt;
          &lt;Navbar/&gt;
        &lt;/div&gt;
        &lt;div className='template'&gt;
          &lt;div className='search'&gt;
              &lt;div className='form-control'&gt;
                &lt;label htmlFor='number'&gt;Search your order Number&lt;/label&gt;
                &lt;input
                  type='name'
                  name='OrderNo'
                  id='OrderNo'
                  value={searchText}
                  onChange={e =&gt; setSearchText(e.target.value)}
                /&gt;
                &lt;button onClick={searchForOrder} className='submit'&gt;search&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    )
  }
  
  </code></pre>
  <p>My code is being successfully compiled but no result is being printed in console and giving me 404 error.</p>
  <p>My error:</p>
  <p>GET http://localhost:3000/[object%20Object] 404 (Not Found)</p>
  <p>I am stuck at here for 2 days if anyone can help me please do.
  thanks in advance!</p>