Go 1.11 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after their
deprecation date. We
recommend that you migrate to the latest supported version of Go.
Client returns an *http.Client using a default urlfetch Transport. This
client will have the default deadline of 5 seconds, and will check the
validity of SSL certificates.
Any deadline of the provided context will be used for requests through this client;
if the client does not have a deadline then a 5 second default is used.
Transport
typeTransportstruct{Contextcontext.Context// Controls whether the application checks the validity of SSL certificates// over HTTPS connections. A value of false (the default) instructs the// application to send a request to the server only if the certificate is// valid and signed by a trusted certificate authority (CA), and also// includes a hostname that matches the certificate. A value of true// instructs the application to perform no certificate validation.AllowInvalidServerCertificatebool}
Transport is an implementation of http.RoundTripper for
App Engine. Users should generally create an http.Client using
this transport and use the Client rather than using this transport
directly.
RoundTrip issues a single HTTP request and returns its response. Per the
http.RoundTripper interface, RoundTrip only returns an error if there
was an unsupported request or the URL Fetch proxy fails.
Note that HTTP response codes such as 5xx, 403, 404, etc are not
errors as far as the transport is concerned and will be returned
with err set to nil.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe urlfetch package provides an \u003ccode\u003ehttp.RoundTripper\u003c/code\u003e implementation for fetching URLs using App Engine's urlfetch service.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eErrTruncatedBody\u003c/code\u003e is returned when a response body is cut short by App Engine's proxy.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eClient\u003c/code\u003e function returns an \u003ccode\u003e*http.Client\u003c/code\u003e that utilizes a default urlfetch \u003ccode\u003eTransport\u003c/code\u003e, applying a default 5-second deadline to requests unless a different context deadline is provided.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTransport\u003c/code\u003e type implements \u003ccode\u003ehttp.RoundTripper\u003c/code\u003e for App Engine, offering control over SSL certificate validation with the \u003ccode\u003eAllowInvalidServerCertificate\u003c/code\u003e option.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRoundTrip\u003c/code\u003e sends a single HTTP request, returning a response without considering HTTP error codes like 404 or 5xx as errors, but will return errors if the request is unsupported or the URL Fetch proxy fails.\u003c/p\u003e\n"]]],[],null,["# Package google.golang.org/appengine/urlfetch (v1.6.7)\n\nVersion 1.6.7keyboard_arrow_down\n\n- [1.6.8 (latest)](/appengine/docs/legacy/standard/go111/reference/latest/urlfetch)\n- [1.6.7](/appengine/docs/legacy/standard/go111/reference/1.6.7/urlfetch) \n**Note:** To get more information about this package, such as access to older versions, view [this package on pkg.go.dev](https://pkg.go.dev/google.golang.org/appengine/urlfetch). \n\u003cbr /\u003e\n\nPackage urlfetch provides an http.RoundTripper implementation\nfor fetching URLs via App Engine's urlfetch service. \n\nVariables\n---------\n\n### ErrTruncatedBody\n\n var ErrTruncatedBody = https://pkg.go.dev/errors.https://pkg.go.dev/errors#New(\"urlfetch: truncated body\")\n\nErrTruncatedBody is the error returned after the final Read() from a\nresponse's Body if the body has been truncated by App Engine's proxy. \n\nFunctions\n---------\n\n### func Client\n\n func Client(ctx https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context) *https://pkg.go.dev/net/http.https://pkg.go.dev/net/http#Client\n\nClient returns an \\*http.Client using a default urlfetch Transport. This\nclient will have the default deadline of 5 seconds, and will check the\nvalidity of SSL certificates.\n\nAny deadline of the provided context will be used for requests through this client;\nif the client does not have a deadline then a 5 second default is used. \n\nTransport\n---------\n\n type Transport struct {\n \tContext https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context\n\n \t// Controls whether the application checks the validity of SSL certificates\n \t// over HTTPS connections. A value of false (the default) instructs the\n \t// application to send a request to the server only if the certificate is\n \t// valid and signed by a trusted certificate authority (CA), and also\n \t// includes a hostname that matches the certificate. A value of true\n \t// instructs the application to perform no certificate validation.\n \tAllowInvalidServerCertificate https://pkg.go.dev/builtin#bool\n }\n\nTransport is an implementation of http.RoundTripper for\nApp Engine. Users should generally create an http.Client using\nthis transport and use the Client rather than using this transport\ndirectly. \n\n### func (\\*Transport) RoundTrip\n\n func (t *#google_golang_org_appengine_urlfetch_Transport) RoundTrip(req *https://pkg.go.dev/net/http.https://pkg.go.dev/net/http#Request) (res *https://pkg.go.dev/net/http.https://pkg.go.dev/net/http#Response, err https://pkg.go.dev/builtin#error)\n\nRoundTrip issues a single HTTP request and returns its response. Per the\nhttp.RoundTripper interface, RoundTrip only returns an error if there\nwas an unsupported request or the URL Fetch proxy fails.\nNote that HTTP response codes such as 5xx, 403, 404, etc are not\nerrors as far as the transport is concerned and will be returned\nwith err set to nil."]]