mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
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:
@@ -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}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user