title: Method PATCH is not allowed by Access-Control-Allow-Methods in preflight response
body: <p>I am using axios PATCH method in ReactJS to update the record but its getting failed with following error</p>
  
  <blockquote>
    <p>Failed to load <a href="http://192.168.99.100:8080/adslots/883" rel="noreferrer">http://192.168.99.100:8080/adslots/883</a>: Method PATCH is not allowed by Access-Control-Allow-Methods in preflight response.</p>
  </blockquote>
  
  <p>Here is my action:</p>
  
  <pre><code>export const UPDATE_AD_SLOTS_REQUEST = 'UPDATE_AD_SLOTS_REQUEST';
  export const UPDATE_AD_SLOTS_SUCCESS = 'UPDATE_AD_SLOTS_SUCCESS';
  export const UPDATE_AD_SLOTS_ERROR = 'UPDATE_AD_SLOTS_ERROR';
  
  
  export function updateAdslotsRequest(){
    return {
      type: UPDATE_AD_SLOTS_REQUEST
    }
  }
  
  export function updateAdslotsSuccess(data){
    return {
      type: UPDATE_AD_SLOTS_SUCCESS,
      data: data
    }
  }
  
  export function updateAdslotsError(errors){
    return {
      type: UPDATE_AD_SLOTS_ERROR,
      erros: errors
    }
  }
  
  export function updateAdslots(data, id) {
    return dispatch =&gt; {
      dispatch(updateAdslotsRequest());
      return axios.patch(`http://192.168.99.100:8080/adslots/${id}`, data)
        .then(res =&gt; {
          dispatch(updateAdslotsSuccess(res.data));      
        })
        .catch(errors =&gt; {
          dispatch(updateAdslotsError(errors));
        })
    }
  }
  </code></pre>
  
  <p>I am totally confused.</p>