如何在BigQuery API调用中重新设置自定义HTTP标头

时间:2017-09-18 23:10:14

标签: google-bigquery

我想在我的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对象。

0 个答案:

没有答案