UrlFetcher
Builds a UrlFetcher over a transport the caller owns. Stable Core. The fetcher never closes the transport. policy is the pre-check's; the transport enforces its own, so pass the same policy to both.
Return
the fetcher.
Parameters
the transport; the caller closes it.
the outbound-URL policy the pre-check applies.
sets the budget, reader, clocks and defaultMaxWait; the defaults when omitted.
Throws
if defaultMaxWait is negative.
Builds a UrlFetcher for URLs an administrator supplies: an Untrusted policy (OutboundUrlPolicy.untrusted()), an owned OkHttpTransport(userAgent, policy), CallBudget.Unlimited unless budget is set. Stable Core. close() closes the transport. See the overload with a policy to add the deployment's own denied ranges or ports.
Return
the fetcher; the caller closes it.
Parameters
the User-Agent sent on every request: non-blank, visible ASCII, no leading or trailing space.
sets the budget, reader, clocks and defaultMaxWait; the defaults when omitted.
Throws
if defaultMaxWait is negative or userAgent is refused by the transport; nothing stays open.
As the overload without a policy, for a policy of the caller's own: OutboundUrlPolicy.untrusted { extraDeniedRanges += … } adds the deployment's own NAT64 prefix or internal ranges. Stable Core. The transport is built with the policy's settings as they are (an Untrusted policy's concurrency caps are part of what makes it untrusted) and the pre-check applies the same policy.
Return
the fetcher; the caller closes it.
Parameters
the User-Agent sent on every request.
the policy the transport enforces and the pre-check applies.
sets the budget, reader, clocks and defaultMaxWait.
Throws
as the overload without a policy, and for a policy.settings.maxResponseBytes above Int.MAX_VALUE - 8.