Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Azure by (13.1k points)
Can anyone help me how to pass POST parameter to Azure Function. I have created 3 Azure function but was not able to pass the POST parameter. Can anyone help me with this?

1 Answer

0 votes
by (26.7k points)

In able to do that, try the below code and it will pass the POST parameter:

public static async void Run(

            [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)]

            HttpRequest req,

            ILogger log)

        {

            var content = await new StreamReader(req.Body).ReadToEndAsync();

            MyClass myClass = JsonConvert.DeserializeObject<MyClass>(content);

        }

I hope this will help.

Want to become an Azure expert? join Azure Developer certification now!!

Want to know more about Azure Developer? Watch this video on How to Become Azure Developer? | Learn Azure:

Browse Categories

...