public enum RequestMethod { GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE }
public class Test { public static void main(String[] args) { for (RequestMethod method : RequestMethod.values()) { System.out.println(method.name()); } } }
结果:
GET
HEAD
POST
PUT
PATCH
DELETE
OPTIONS
TRACE