com.google.api.client.http.HttpResponse.ignore()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中com.google.api.client.http.HttpResponse.ignore()方法的一些代码示例,展示了HttpResponse.ignore()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpResponse.ignore()方法的具体详情如下:
包路径:com.google.api.client.http.HttpResponse
类名称:HttpResponse
方法名:ignore

HttpResponse.ignore介绍

暂无

代码示例

代码示例来源:origin: google/google-api-java-client-samples

response.ignore();
} catch (HttpResponseException e) {

代码示例来源:origin: com.google.api-client/google-api-client

/**
 * Sends the metadata request using HEAD to the server and returns the raw metadata
 * {@link HttpResponse} for the response headers.
 *
 * <p>
 * Only supported when the original request method is GET. The response content is assumed to be
 * empty and ignored. Calls {@link HttpResponse#ignore()} so there is no need to disconnect the
 * response. Example usage:
 * </p>
 *
 * <pre>
  HttpResponse response = request.executeUsingHead();
  // look at response.getHeaders()
 * </pre>
 *
 * <p>
 * Subclasses may override by calling the super implementation.
 * </p>
 *
 * @return the {@link HttpResponse}
 */
protected HttpResponse executeUsingHead() throws IOException {
 Preconditions.checkArgument(uploader == null);
 HttpResponse response = executeUnparsed(true);
 response.ignore();
 return response;
}

代码示例来源:origin: com.google.oauth-client/google-oauth-client-extensions

@Override
protected void service(HttpServletRequest req, HttpServletResponse resp)
  throws ServletException, IOException {
 PersistenceManager pm = getPersistenceManagerFactory().getPersistenceManager();
 req.setAttribute(AUTH_PERSISTENCE_MANAGER, pm);
 try {
  // Invoke the user code
  super.service(req, resp);
 } catch (HttpResponseException e) {
  // After this catch block, control flow would be returned to the servlet container, therefore
  // Google APIs client requests will have their content consumed here to make it available for
  // logging.
  e.getResponse().ignore();
  throw e;
 } finally {
  pm.close();
 }
}

代码示例来源:origin: stackoverflow.com

System.out.println(httpResponse.parseAsString());
} finally {
  httpResponse.ignore();

代码示例来源:origin: com.google.api.client/google-api-client-googleapis

/**
  * Revokes the long-lived access token.
  *
  * @param parameters OAuth parameters
  * @throws IOException I/O exception
  * @since 1.3
  */
 public static void revokeAccessToken(HttpTransport transport, OAuthParameters parameters)
   throws IOException {
  HttpRequest request = transport.createRequestFactory().buildGetRequest(
    new GenericUrl("https://www.google.com/accounts/AuthSubRevokeToken"));
  parameters.intercept(request);
  request.execute().ignore();
 }
}

代码示例来源:origin: com.google.api.client/google-api-client-googleapis

/**
 * Revokes the session token. Clears any existing authorization header of the Google transport and
 * automatically resets the token by calling {@code setToken(null)}.
 * <p>
 * See <a href= "http://code.google.com/apis/accounts/docs/AuthSub.html#AuthSubRevokeToken"
 * >AuthSubRevokeToken</a> for protocol details.
 *
 * @throws HttpResponseException if the authentication response has an error code
 * @throws IOException some other kind of I/O exception
 */
public void revokeSessionToken() throws IOException {
 HttpTransport authSubTransport = this.authSubTransport;
 HttpRequest request = authSubTransport.createRequestFactory().buildGetRequest(
   new GenericUrl("https://www.google.com/accounts/AuthSubRevokeToken"));
 request.execute().ignore();
 setToken(null);
}

代码示例来源:origin: com.google.oauth-client/google-oauth-client-extensions

e.getResponse().ignore();

代码示例来源:origin: com.google.api-client/google-api-client

} finally {
 if (parser == null) {
  response.ignore();
 } else if (details == null) {
  parser.close();

相关文章