package net.northking.cctp.element.internal.protocol.http;

/**
 * 支持的HTTP请求类型
 *
 * @author fengxiang.zhang
 * @since 1.0
 */
public enum RequestMethod {
    GET, POST, DELETE, HEAD, OPTIONS, PUT, PATCH, TRACE, // HTTP1.1
    PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, REPORT, MKCALENDAR, SEARCH;// 其他扩展方法

    public static RequestMethod from(String method) {
        for (RequestMethod e : RequestMethod.values()) {
            if (e.name().equalsIgnoreCase(method)) {
                return e;
            }
        }
        throw new IllegalArgumentException(String.format("请求方法:%s 不被支持.", method));
    }
}