我想在我的HTTP查询中设置自定义HTTP身份验证标头
到目前为止我的代码看起来像这样:
HttpRequestInitializer httpRequestInitializer = new HttpRequestInitializer() {
@Override
public void initialize(HttpRequest httpRequest) throws IOException {
HttpHeaders httpHeaders = httpRequest.getHeaders();
httpHeaders.putAll(httpHeadersMap);
httpRequest.setHeaders(httpHeaders);
}
};
Bigquery bigquery = new Bigquery.Builder(TRANSPORT, JSON_FACTORY, credential)
.setApplicationName(APP_NAME)
.setHttpRequestInitializer(httpRequestInitializer)
.build();
问题是我需要每隔几个小时刷新一次这个标题。
那么,如何在NEXT时间重置标头,因为setHttpRequestInitializer()
看起来像是Bigquery
对象。