com.github.firelcw.interceptor.HttpInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easy-http Show documentation
Show all versions of easy-http Show documentation
A simple HTTP client for Java
package com.github.firelcw.interceptor;
import com.github.firelcw.model.ExcludePath;
import com.github.firelcw.model.HttpRequest;
import com.github.firelcw.model.HttpRequestConfig;
import com.github.firelcw.model.HttpResponse;
import java.util.Collections;
import java.util.List;
/**
* 响应拦截器
* @author liaochongwei
* @date 2020/7/31 13:43
*/
public interface HttpInterceptor {
/**
* 前置拦截
* @param config 请求配置
* @param request 后置拦截
* @return boolean
*/
boolean preHandle(HttpRequest request, HttpRequestConfig config);
/**
* 后置拦截
* @param request
* @param response
*/
void postHandle(HttpRequest request, HttpResponse response);
/**
* 执行顺序(值越小越先执行)
* @return int
*/
default int order() {
return 0;
}
/**
* 排除路径
* @return List
*/
default List excludes() {
return Collections.emptyList();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy