
org.zodiac.sdk.nio.http.common.HTTPMethod Maven / Gradle / Ivy
package org.zodiac.sdk.nio.http.common;
public enum HTTPMethod {
GET,
POST;
public static HTTPMethod of(final String value) {
String _value = value;
if (null == _value) {
throw new IllegalArgumentException("Invalid http method specified: " + value);
}
_value = _value.trim().toUpperCase();
if (0 == _value.length()) {
throw new IllegalArgumentException("Invalid http method specified: " + value);
}
switch (value) {
case "GET":
//case "get":
return GET;
case "POST":
//case "post":
return POST;
default:
throw new IllegalArgumentException("Invalid http method specified: " + value);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy