azure-functions-python-library icon indicating copy to clipboard operation
azure-functions-python-library copied to clipboard

Support HTTPStatus IntEnum for status code return values.

Open tkutcher opened this issue 3 years ago • 3 comments

I wound up using the HTTPStatus IntEnum for a status code in my func.HttpResponse returns but noticed the actual web response I was getting was always 200, even when doing something like status_code=HTTPStatus.BAD_REQUEST.

Just to verify, I did confirm that returning int(HTTPStatus.BAD_REQUEST) on my side of things seemed to fix. So maybe this is addressable in the azure-functions-python-library code (not even sure if it is a worker thing in the first place).

Minor, but it would be convenient to be able to use HTTPStatus. Thought I'd suggest the enhancement since it caused me some head scratching to figure out why I was getting 200's that didn't make sense and it should be an easy tweak.

tkutcher avatar Nov 24 '22 04:11 tkutcher

@tkutcher Thanks for reporting, we will discuss this enhancement with our next level team and update the status.

ramya894 avatar Nov 24 '22 07:11 ramya894

@tkutcher , we have discussed with the team and this enhancement can be implemented, we are working on it and update you once it is available.

ramya894 avatar Dec 01 '22 07:12 ramya894

https://github.com/Azure/azure-functions-python-library/pull/161

YunchuWang avatar Jan 25 '23 21:01 YunchuWang