Skip to content

Commit 5c75b92

Browse files
Merge pull request #261928 from ggailey777/patch-2
[Functions] Fix Python v2 descriptions for HTTP trigger
2 parents 5c66700 + 9fabbb0 commit 5c75b92

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

articles/azure-functions/functions-reference-python.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,13 +604,9 @@ Likewise, you can set the `status_code` and `headers` for the response message i
604604

605605
::: zone pivot="python-mode-decorators"
606606

607-
The HTTP trigger is defined in the *function.json* file. The `name` of the binding must match the named parameter in the function.
608-
609-
In the previous examples, a binding name `req` is used. This parameter is an [HttpRequest] object, and an [HttpResponse] object is returned.
607+
The HTTP trigger is defined as a method that takes a named binding parameter, which is an [HttpRequest] object, and returns an [HttpResponse] object. You apply the `function_name` decorator to the method to define the function name, while the HTTP endpoint is set by applying the `route` decorator.
610608

611-
From the [HttpRequest] object, you can get request headers, query parameters, route parameters, and the message body.
612-
613-
The following example is from the HTTP trigger template for the Python v2 programming model. It's the sample code that's provided when you create a function by using Azure Functions Core Tools or Visual Studio Code.
609+
This example is from the HTTP trigger template for the Python v2 programming model, where the binding parameter name is `req`. It's the sample code that's provided when you create a function by using Azure Functions Core Tools or Visual Studio Code.
614610

615611
```python
616612
@app.function_name(name="HttpTrigger1")
@@ -636,7 +632,7 @@ def test_function(req: func.HttpRequest) -> func.HttpResponse:
636632
)
637633
```
638634

639-
In this function, you obtain the value of the `name` query parameter from the `params` parameter of the [HttpRequest] object. You read the JSON-encoded message body by using the `get_json` method.
635+
From the [HttpRequest] object, you can get request headers, query parameters, route parameters, and the message body. In this function, you obtain the value of the `name` query parameter from the `params` parameter of the [HttpRequest] object. You read the JSON-encoded message body by using the `get_json` method.
640636

641637
Likewise, you can set the `status_code` and `headers` for the response message in the returned [HttpResponse] object.
642638

0 commit comments

Comments
 (0)