Why My Fetch Request Didn’t Work

I recently troubleshot an issue with an application I had running on a local JSON server which prevented me from applying PATCH requests. Specifically, it was throwing a CORS error.

If you are running into a similar issue using fetch, here’s a TL;DR for the weary programmer: Convention is to always write your request methods in upcase.

Per HTTP specification, PATCH requests are not normalized so: ‘patch’!==‘PATCH’. By contrast, PUT requests are normalized, ‘put’==’PUT’.