Java 获取HTTP和HTTPS值常量的任何方法
定义HTTP和HTTPs常量值时是否存在类。到现在为止,我已经创建了一个自定义类Java 获取HTTP和HTTPS值常量的任何方法,java,spring,rest,Java,Spring,Rest,定义HTTP和HTTPs常量值时是否存在类。到现在为止,我已经创建了一个自定义类 public static class UrlConstants { private UrlConstants() { super(); } /** The Constant HTTP. */ public static final String HTTP = "http"; } 这可能有助于您的查询,这是来自org.springframework.htt
public static class UrlConstants {
private UrlConstants() {
super();
}
/** The Constant HTTP. */
public static final String HTTP = "http";
}
这可能有助于您的查询,这是来自
org.springframework.http
package的。如果您没有清楚地说明您所问的问题,这个问题将结束。我不需要状态代码。我想要一个定义http和hhtps常量的类。到目前为止,我正在定义自定义常量classI,我不知道Spring中有任何这样的类,但您可以从org.apache.http引用HttpStatus接口,这里定义了所有常量枚举。
HttpStatus.OK.value() will return the integer value of the status code.