I'm writing (as an exercise) an Express + React application that manages a To Do list. You can see the code on GitHub.
Each task has a Done button that sends a PATCH request to the server. However, when I press it I get a 400 Bad Request
.
Furthermore,
The same behavior is observed in Chrome, Edge, and Firefox.
Any ideas?
I found the cause: I spelled patch
in lowercase. Apparently, Express only recognizes PATCH
in uppercase.
Strangely enough, this idiosyncrasy doesn't apply to other methods like post
and delete
, which are recognized also in lowercase.
Fiddler probably converts all method names to uppercase before forwarding the requests to the server.