Clarify semantics of HttpMethod.valueOf()

HttpMethod.valueOf() performs a case-sensitive lookup of predefined
HttpMethod constants. For example, valueOf("GET") resolves to
HttpMethod.GET, whereas valueOf("get") results in a newly created
HttpMethod instance.
Update the Javadoc to explicitly document this behavior.

See gh-36642
Closes gh-36652

Signed-off-by: angry-2k <edkev@kakao.com>
This commit is contained in:
angry2.k
2026-04-14 16:15:43 +02:00
committed by GitHub
parent ff3f2937ab
commit df828458fa
@@ -110,6 +110,10 @@ public final class HttpMethod implements Comparable<HttpMethod>, Serializable {
/**
* Return an {@code HttpMethod} object for the given value.
* <p>Note that this lookup is case-sensitive. For predefined constants,
* the method value must be provided in uppercase (e.g., {@code "GET"},
* {@code "POST"}). If no predefined constant matches, a new
* {@code HttpMethod} instance is returned for the given value as-is.
* @param method the method value as a String
* @return the corresponding {@code HttpMethod}
*/