com.jianggujin.http.support.annotation.JApiRequest Maven / Gradle / Ivy
The newest version!
/**
* Copyright 2018 jianggujin (www.jianggujin.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jianggujin.http.support.annotation;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import com.jianggujin.http.core.JMethod;
import com.jianggujin.http.util.JDataUtils;
/**
* API请求信息
*
* @author jianggujin
*
*/
@Retention(RUNTIME)
@Target({ METHOD })
public @interface JApiRequest {
/**
* 请求路径,如果设置了{@link JBaseUrl},则会将两部分拼起来,否则该参数则为请求地址
*
* @return
*/
String value();
/**
* 请求方法
*
* @return
*/
JMethod method() default JMethod.GET;
/**
* 忽略HTTP响应式状态码错误
*
* @return
*/
boolean ignoreError() default false;
/**
* 编码
*
* @return
*/
String charset() default JDataUtils.DEFAULT_CHARSET;
/**
* 强制方法存在请求体
*
* @return
*/
boolean forceHasBody() default false;
/**
* 超时时间
*
* @return
*/
int timeout() default JDataUtils.DEFAULT_TIME_OUT;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy