@@ -223,16 +223,16 @@ Update *HttpExample\\function_app.py* to match the following code. Add the `toDo
223
223
import azure.functions as func
224
224
import logging
225
225
from azure.functions.decorators.core import DataType
226
+ import uuid
226
227
227
228
app = func.FunctionApp()
228
229
229
230
@app.function_name (name = " HttpTrigger1" )
230
231
@app.route (route = " hello" , auth_level = func.AuthLevel.ANONYMOUS )
231
- @app.generic_output_binding (arg_name = " toDoItems" , type = " sql" , CommandText = " dbo.ToDo" , ConnectionStringSetting = " SqlConnectionString"
232
- data_type = DataType.STRING )
232
+ @app.generic_output_binding (arg_name = " toDoItems" , type = " sql" , CommandText = " dbo.ToDo" , ConnectionStringSetting = " SqlConnectionString" ,data_type = DataType.STRING )
233
233
def test_function (req : func.HttpRequest, toDoItems : func.Out[func.SqlRow]) -> func.HttpResponse:
234
234
logging.info(' Python HTTP trigger function processed a request.' )
235
- name = req.params .get(' name' )
235
+ name = req.get_json() .get(' name' )
236
236
if not name:
237
237
try :
238
238
req_body = req.get_json()
@@ -242,7 +242,7 @@ def test_function(req: func.HttpRequest, toDoItems: func.Out[func.SqlRow]) -> fu
242
242
name = req_body.get(' name' )
243
243
244
244
if name:
245
- toDoItems.set(func.SqlRow({" id " : uuid.uuid4(), " title" : name, " completed" : false, url: " " }))
245
+ toDoItems.set(func.SqlRow({" Id " : str ( uuid.uuid4()) , " title" : name, " completed" : False , " url" : " " }))
246
246
return func.HttpResponse(f " Hello { name} ! " )
247
247
else :
248
248
return func.HttpResponse(
0 commit comments