新增印度股票K线,英情接口
This commit is contained in:
@@ -10,6 +10,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.github.pagehelper.StringUtil;
|
||||
import okhttp3.*;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
@@ -73,6 +74,29 @@ public class HttpClientRequest {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static String http2Get(String url) throws IOException {
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.protocols(java.util.Arrays.asList(Protocol.HTTP_2, Protocol.HTTP_1_1))
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url(url) // 替换为你要请求的URL
|
||||
.addHeader("Cf-Ray", "82e0bc56ccabfabe-SJC")
|
||||
.addHeader("X-Correlation-Id", "a3120e84-ab22-4a03-81bc-270bbb373c1f")
|
||||
.addHeader("Server", "cloudflare")
|
||||
.addHeader("Cf-Cache-Status", "DYNAMIC")
|
||||
.addHeader("Alt-Svc", "h3=\":443\"; ma=86400")
|
||||
.addHeader("Date", "Thu, 30 Nov 2023 05:36:57 GMT")
|
||||
.addHeader("Content-Encoding", "br")
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.addHeader("X-Envoy-Upstream-Service", "434")
|
||||
.addHeader("Via", "1.1 google")
|
||||
.addHeader("X-App-Version", "1.45.3")
|
||||
.addHeader("Cf-Cache-Status", "DYNAMIC")
|
||||
.build();
|
||||
Call call = client.newCall(request);
|
||||
Response response = call.execute();
|
||||
return response.body().string();
|
||||
}
|
||||
/**
|
||||
* 获取cooike
|
||||
* @param url
|
||||
|
||||
Reference in New Issue
Block a user