title: inserting header axios async thunk
body: <p>I'm trying to set apikey in the header of req-- it gives me Cors error when done locally,
  though when done on postman it goes through</p>
  <pre class="lang-js prettyprint-override"><code>export const fetchCreativeAd = createAsyncThunk(
    'creativeAd/fetchCreativeAd',
    async (payload, thunkAPI) =&gt; {
      try {
        const urlParam = process.env.NEXT_PUBLIC_AWS_ENDPOINT;
        const response = await axios.get(
          `${urlParam}/creative_ad?product_name=${payload.productName}&amp;product_description=${payload.productDescription}&amp;platform=${payload.platform}&amp;audience=${payload.audience}&amp;ad_tone=${payload.adTone}`,
          {
            headers: {
              'x-api-key': `${process.env.NEXT_PUBLIC_AWS_API_KEY}`,
            },
          }
        );
        res.data.headers['x-api-key'];
        console.log(process.env.NEXT_PUBLIC_AWS_API_KEY);
        return response;
      } catch (error) {
        return thunkAPI.rejectWithValue({ error: error.message });
      }
    }
  );
  </code></pre>
  <p>Cors error:</p>
  <blockquote>
  <p>Access to XMLHttpRequest at '&quot;urlParam&quot;creative_ad?product_name=asdf&amp;product_description=asdf&amp;platform=asdf&amp;audience=asdf&amp;ad_tone=asdf' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.</p>
  </blockquote>
  <p>how do I insert the header portion in axios?</p>