On 13/03/2013 09:12, Jörg Schaible wrote: > Hi Simo, > > Simone Tripodi wrote: > >> Hi Felix! >> >>> >>> See RFC-2616 5.1.1 Method. >>> >> >> the paragraph is indeed clear about that: >> >> The Method token indicates the method to be performed on the >> resource identified by the Request-URI. The method is case-sensitive. >> >> Method = "OPTIONS" ; Section 9.2 >> | "GET" ; Section 9.3 >> | "HEAD" ; Section 9.4 >> | "POST" ; Section 9.5 >> | "PUT" ; Section 9.6 >> | "DELETE" ; Section 9.7 >> | "TRACE" ; Section 9.8 >> | "CONNECT" ; Section 9.9 >> | extension-method >> extension-method = token >> >>> So IMHO there is no need for equalsIgnoreCase or toLowerCase at all and >>> "POST".equals(...) should just do it. >>> >> >> I'm by your side, I switch my opinion to having just equals() here. >> >> What other people think? > > Follow the RFC.
Indeed. <quote rfc="2616", section="19.3"> Although this document specifies the requirements for the generation of HTTP/1.1 messages, not all applications will be correct in their implementation. We therefore recommend that operational applications be tolerant of deviations whenever those deviations can be interpreted unambiguously. </quote> Using equalsIgnoreCase() is the better solution in this case. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
