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\u003ePackage urlfetch offers an http.RoundTripper implementation for fetching URLs through App Engine's urlfetch service.\u003c/p\u003e\n"],["\u003cp\u003eThe ErrTruncatedBody variable indicates that the response body has been cut short by App Engine's proxy.\u003c/p\u003e\n"],["\u003cp\u003eThe Client function provides an *http.Client with a default urlfetch Transport, featuring a 5-second deadline and SSL certificate validation.\u003c/p\u003e\n"],["\u003cp\u003eThe Transport type is an http.RoundTripper implementation for App Engine, and it also includes an option to allow invalid SSL certificates.\u003c/p\u003e\n"],["\u003cp\u003eThe RoundTrip method sends a single HTTP request and returns its response, with errors only occurring due to unsupported requests or proxy failures.\u003c/p\u003e\n"]]],[],null,["# Package google.golang.org/appengine/v2/urlfetch (v2.0.6)\n\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/v2/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/context.https://pkg.go.dev/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/context.https://pkg.go.dev/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_v2_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."]]