21
21
import tempfile
22
22
# [END functions_http_form_data]
23
23
24
+ # [START functions_http_cors]
25
+ # [START functions_http_cors_auth]
26
+ # [START functions_http_xml]
27
+ # [START functions_http_form_data]
28
+ import functions_framework
29
+
30
+ # [END functions_http_form_data]
31
+ # [END functions_http_xml]
32
+ # [END functions_http_cors_auth]
33
+ # [END functions_http_cors]
34
+
24
35
# [START functions_http_form_data]
25
36
from werkzeug .utils import secure_filename
26
37
# [END functions_http_form_data]
31
42
32
43
33
44
# [START functions_http_xml]
34
-
45
+ @ functions_framework . http
35
46
def parse_xml (request ):
36
47
""" Parses a document of type 'text/xml'
37
48
Args:
@@ -56,6 +67,7 @@ def get_file_path(filename):
56
67
return os .path .join (tempfile .gettempdir (), file_name )
57
68
58
69
70
+ @functions_framework .http
59
71
def parse_multipart (request ):
60
72
""" Parses a 'multipart/form-data' upload request
61
73
Args:
@@ -92,6 +104,7 @@ def parse_multipart(request):
92
104
93
105
94
106
# [START functions_http_cors]
107
+ @functions_framework .http
95
108
def cors_enabled_function (request ):
96
109
# For more information about CORS and CORS preflight requests, see:
97
110
# https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
@@ -119,6 +132,7 @@ def cors_enabled_function(request):
119
132
120
133
121
134
# [START functions_http_cors_auth]
135
+ @functions_framework .http
122
136
def cors_enabled_function_auth (request ):
123
137
# For more information about CORS and CORS preflight requests, see
124
138
# https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
0 commit comments