I find that I can use both get post put delete method in uppercase or lowercase,But I can only use patch method uppercase to make it work.
var xhr = new XMLHttpRequest();
xhr.open('PATCH',url); //works
xhr.open('patch',url); //get error net::ERR_EMPTY_RESPONSE
xhr.send();

HTTP request methods are defined to be uppercase. Section 3.1.1 of the HTTP/1.1 RFC says
The request method is case-sensitive.
Since XMLHttpRequest simply sends the given request method to the server, the above proscription applies there as well.
Some servers may accept lowercase request methods as an application of the Robustness Principle, but for the same reason you should not send them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With