PATCH Case Sensitivity

nkratzmeyer

Nathan Kratzmeyer

Posted on October 22, 2019

PATCH Case Sensitivity

For Future Reference

I had the following code in my front-end app:

  const result = await fetch(url, {
    method: 'patch',
    headers: {
      'Content-Type': 'application/json'
    },
    body: json,
    mode: 'cors'
  });

Enter fullscreen mode Exit fullscreen mode

I was getting CORS errors but I could see that the OPTIONS request was sending back PATCH as an allowed method. After banging my head against a wall for at least 2 hours, I finally stumbled on this StackOverflow post. BOOM! Problem solved! "patch" needed to be "PATCH".

Hope this helps someone!

💖 💪 🙅 🚩
nkratzmeyer
Nathan Kratzmeyer

Posted on October 22, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

PATCH Case Sensitivity
node PATCH Case Sensitivity

October 22, 2019