# Google Data APIs Client Library (1.43.0)

## com.google.gdata.client.http
Class GoogleGDataRequest

    java.lang.Object
      com.google.gdata.client.http.HttpGDataRequest
          com.google.gdata.client.http.GoogleGDataRequest

All Implemented Interfaces:
  Service.GDataRequest

    public class GoogleGDataRequest

extends HttpGDataRequest

The GoogleGDataRequest class provides a basic implementation of an interface to connect with a Google-GData server.

Nested Class Summary
`static class` `GoogleGDataRequest.Factory` The GoogleGDataRequest.Factory class is a factory class for constructing new GoogleGDataRequest instances.
`static class` `GoogleGDataRequest.GoogleCookie` Google cookie.

Nested classes/interfaces inherited from interface com.google.gdata.client.Service.GDataRequest
`Service.GDataRequest.RequestType`

Field Summary
`static java.lang.String` `DISABLE_COOKIE_HANDLER_PROPERTY` If set, this System property will globally disable interception and handling of cookies for all GData services.

Fields inherited from class com.google.gdata.client.http.HttpGDataRequest
`connectionSource, connectTimeout, executed, expectsInput, hasOutput, httpConn, inputType, METHOD_OVERRIDE_HEADER, METHOD_OVERRIDE_PROPERTY, readTimeout, requestUrl, type`

Constructor Summary

`protected`

`GoogleGDataRequest(Service.GDataRequest.RequestType type, java.net.URL requestUrl, ContentType contentType, HttpAuthToken authToken, java.util.Map<java.lang.String,java.lang.String> headerMap, java.util.Map<java.lang.String,java.lang.String> privateHeaderMap, HttpUrlConnectionSource connectionSource)`
Constructs a new GoogleGDataRequest instance of the specified RequestType, targeting the specified URL with the specified authentication token.

Method Summary
`void` `execute()` Executes the GData service request.
`Version` `getRequestVersion()` Returns the `Version` that will be used to execute the request on the target service or `null` if the service is not versioned.
`Version` `getResponseVersion()` Returns the `Version` that was used by the target service to execute the request or `null` if the service is not versioned.
`protected void` `handleErrorResponse()` Handles an error response received while executing a GData service request.
`void` `setService(GoogleService service)` Sets the GoogleService associated with the request.

Methods inherited from class com.google.gdata.client.http.HttpGDataRequest
`checkResponse, end, getConnection, getParseSource, getRequestConnection, getRequestContentType, getRequestStream, getRequestUrl, getRequestWriter, getResponseContentType, getResponseDateHeader, getResponseHeader, getResponseStream, setConnectTimeout, setEtag, setHeader, setIfModifiedSince, setMethod, setPrivateHeader, setReadTimeout`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DISABLE_COOKIE_HANDLER_PROPERTY

    public static final java.lang.String DISABLE_COOKIE_HANDLER_PROPERTY

  If set, this System property will globally disable interception and handling of cookies for all GData services.

  See Also:
    Constant Field Values

Constructor Detail

### GoogleGDataRequest

    protected GoogleGDataRequest(Service.GDataRequest.RequestType type,
                                 java.net.URL requestUrl,
                                 ContentType contentType,
                                 HttpAuthToken authToken,
                                 java.util.Map<java.lang.String,java.lang.String> headerMap,
                                 java.util.Map<java.lang.String,java.lang.String> privateHeaderMap,
                                 HttpUrlConnectionSource connectionSource)
                          throws java.io.IOException

  Constructs a new GoogleGDataRequest instance of the specified RequestType, targeting the specified URL with the specified authentication token.

  Parameters:
    `type` - type of GDataRequest
    `requestUrl` - request target URL
    `authToken` - token authenticating request to server
    `headerMap` - map containing additional headers to set
    `privateHeaderMap` - map containing additional headers to set that should not be logged (eg. authentication info)
  Throws:
    `java.io.IOException` - on error initializing service connection

Method Detail

### getRequestVersion

    public Version getRequestVersion()

  Returns the `Version` that will be used to execute the request on the target service or `null` if the service is not versioned.

  Returns:
    version sent with the request or `null`.

### getResponseVersion

    public Version getResponseVersion()

  Returns the `Version` that was used by the target service to execute the request or `null` if the service is not versioned.

  Returns:
    version returned with the response or `null`.

### setService

    public void setService(GoogleService service)

  Sets the GoogleService associated with the request.

### execute

    public void execute()
                 throws java.io.IOException,
                        ServiceException

  Description copied from interface: `Service.GDataRequest`
  Executes the GData service request.

  Specified by:
    `execute` in interface `Service.GDataRequest`
  Overrides:
    `execute` in class `HttpGDataRequest`
  Throws:
    `java.io.IOException` - error writing to or reading from GData service.
    `ResourceNotFoundException` - invalid request target resource.
    `ServiceException` - system error executing request.

### handleErrorResponse

    protected void handleErrorResponse()
                                throws java.io.IOException,
                                       ServiceException

  Description copied from class: `HttpGDataRequest`
  Handles an error response received while executing a GData service request. Throws a `ServiceException` or one of its subclasses, depending on the failure conditions.

  Overrides:
    `handleErrorResponse` in class `HttpGDataRequest`
  Throws:
    `java.io.IOException` - error reading the error response from the GData service.
    `ServiceException` - exception describing the failure.