MCPcopy Create free account
hub / github.com/Selina1981/yanglegeyang / intercept

Method intercept

src/main/java/util/HttpClient.java:32–42  ·  view source on GitHub ↗
(Chain chain)

Source from the content-addressed store, hash-verified

30 //添加请求头
31 .addInterceptor(new Interceptor() {
32 @Override
33 public Response intercept(Chain chain) throws IOException {
34 //添加请求头
35 Request request = chain.request().newBuilder()
36 .addHeader("Host", host)
37 .addHeader("User-Agent", userAgent)
38 .addHeader("xRequestedWith", xRequestedWith)
39 .build();
40
41 return chain.proceed(request);
42 }
43 });
44 }
45

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected