Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.appengine.api.urlfetch
Class FetchOptions

    java.lang.Object
      com.google.appengine.api.urlfetch.FetchOptions

    public final class FetchOptions

extends java.lang.Object

Allows users to customize the behavior of `URLFetchService` operations.

If `allowTruncate` is called, `URLFetchService` will truncate large responses and return them without error.

If (@link #disallowTruncate} is called, `ResponseTooLargeException` will be thrown if the response is too large.

If `followRedirects` is called the `URLFetchService` operation will follow redirects.

If `doNotFollowRedirects()` is called the `URLFetchService` operation will not follow redirects.

Notes on usage:
The recommended way to instantiate a `FetchOptions` object is to statically import `FetchOptions.Builder`.* and invoke a static creation method followed by an instance mutator (if needed):

>      import static com.google.appengine.api.urlfetch.FetchOptions.Builder.*;

>      ...
>      URL url = getURLToFetch();
>      urlFetchService.fetch(url, allowTruncate());

>      urlFetchService.fetch(url, allowTruncate().doNotFollowRedirects());

Nested Class Summary
`static class` | `FetchOptions.Builder` Contains static creation methods for `FetchOptions`.

Field Summary
`static boolean` | `DEFAULT_ALLOW_TRUNCATE`
`static boolean` | `DEFAULT_FOLLOW_REDIRECTS`

Method Summary
`FetchOptions` | `allowTruncate()` Enables response truncation.
`FetchOptions` | `disallowTruncate()` Disables response truncation.
`FetchOptions` | `doNotFollowRedirects()` Disables following of redirects.
`FetchOptions` | `followRedirects()` Enables following of redirects.

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

Field Detail

### DEFAULT_ALLOW_TRUNCATE

    public static final boolean DEFAULT_ALLOW_TRUNCATE

See Also:
  Constant Field Values

### DEFAULT_FOLLOW_REDIRECTS

    public static final boolean DEFAULT_FOLLOW_REDIRECTS

See Also:
  Constant Field Values

Method Detail

### allowTruncate

    public FetchOptions allowTruncate()

  Enables response truncation. Please read the class javadoc for an explanation of how allowTruncate is used.

  Returns:
    `this` (for chaining)

### disallowTruncate

    public FetchOptions disallowTruncate()

  Disables response truncation. Please read the class javadoc for an explanation of how allowTruncate is used.

  Returns:
    `this` (for chaining)

### followRedirects

    public FetchOptions followRedirects()

  Enables following of redirects. Please read the class javadoc for an explanation of how followRedirects is used.

  Returns:
    `this` (for chaining)

### doNotFollowRedirects

    public FetchOptions doNotFollowRedirects()

  Disables following of redirects. Please read the class javadoc for an explanation of how doNotFollowRedirects is used.

  Returns:
    `this` (for chaining)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD