Documentation ¶
Overview ¶
Package http provides a set of HTTP Cloud Functions samples.
Package http provides a set of HTTP Cloud Functions samples.
Package http provides a set of HTTP Cloud Functions samples.
Package http provides a set of HTTP Cloud Functions samples.
Package http provides a set of HTTP Cloud Functions samples.
Package http provides a set of HTTP Cloud Functions samples.
Package http provides a set of HTTP Cloud Functions samples.
Package http provides a set of HTTP Cloud Functions samples.
Index ¶
- func CORSEnabledFunction(w http.ResponseWriter, r *http.Request)
- func CORSEnabledFunctionAuth(w http.ResponseWriter, r *http.Request)
- func ExecutionCount(w http.ResponseWriter, r *http.Request)
- func HelloContentType(w http.ResponseWriter, r *http.Request)
- func HelloHTTPMethod(w http.ResponseWriter, r *http.Request)
- func MakeRequest(w http.ResponseWriter, r *http.Request)
- func ParseXML(w http.ResponseWriter, r *http.Request)
- func UploadFile(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSEnabledFunction ¶
func CORSEnabledFunction(w http.ResponseWriter, r *http.Request)
CORSEnabledFunction is an example of setting CORS headers. For more information about CORS and CORS preflight requests, see https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request.
func CORSEnabledFunctionAuth ¶
func CORSEnabledFunctionAuth(w http.ResponseWriter, r *http.Request)
CORSEnabledFunctionAuth is an example of setting CORS headers with authentication enabled. For more information about CORS and CORS preflight requests, see https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request.
func ExecutionCount ¶
func ExecutionCount(w http.ResponseWriter, r *http.Request)
ExecutionCount is an HTTP Cloud Function that counts how many times it is executed within a specific instance.
func HelloContentType ¶
func HelloContentType(w http.ResponseWriter, r *http.Request)
HelloContentType is an HTTP Cloud function. It uses the Content-Type header to identify the request payload format.
func HelloHTTPMethod ¶
func HelloHTTPMethod(w http.ResponseWriter, r *http.Request)
HelloHTTPMethod is an HTTP Cloud function. It uses the request method to differentiate the response.
func MakeRequest ¶
func MakeRequest(w http.ResponseWriter, r *http.Request)
MakeRequest is an example of making an HTTP request. MakeRequest uses a single http.Client for all requests to take advantage of connection pooling and caching. See https://godoc.org/net/http#Client.
func ParseXML ¶
func ParseXML(w http.ResponseWriter, r *http.Request)
ParseXML is an example of parsing a text/xml request.
func UploadFile ¶
func UploadFile(w http.ResponseWriter, r *http.Request)
UploadFile processes a 'multipart/form-data' upload request.
Types ¶
This section is empty.