Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use req.get_body() in azure function in python and what is purpose?

I am new in Azure function. I'm unable to understand what is the purpose of req.get_body() in azure function?? Can we pass binary image content in local host api(e.g-http://localhost:7071/api/HttpTrigger1) by using req.get_body()?? If yes, Please tell me how to pass binary image content in local host. I'm trying it with name = req.params.get('name'). But problem is that if image content is small then i can pass successfully but if image content is large it show error.

Please help me out

like image 434
BhuriStray Avatar asked Oct 15 '25 10:10

BhuriStray


1 Answers

Yes, as you mentioned in question, "Get" method request can just be used with small request parameter. If your image content is large, we'd better to use "Post" method to request the function and put the binary in the request body of "Post" request. Apart from this, "Post" method is more security than "Get" method request.

When you test in local, you just need to use "Postman" to do it. Download "Postman" and do it like below screenshot:

enter image description here

like image 81
Hury Shen Avatar answered Oct 16 '25 23:10

Hury Shen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!