Hi @Guillermo Amorin Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
I have tested this with Python Version 3.11 and function app runtime version 4.1036.2.2. I could pass the payload without any issues and can parse it through the function app. That being said, there are couple of changes you can make in the code and see if that produces the expected results.
I request you to pass in the Content-Type as application/json through the headers and see if that makes any difference. Although Python app works with single-quotes for strings, if you try to validate the data using a JSON validator, it would fail as it expects double-quotes. Please try the payload in the following format and see if that helps
headers = {"Content-Type": "application/json", "x-functions-key": functionKey}
# Create a payload for the POST request
payload = {
"threadId": 13,
"question": "hellomessage",
"field3": "auto",
"userId": 206040,
"userName": "gatoPaco"
}
# Make the POST request
response = requests.post(url, json=payload, headers=headers)
# Print the response from the server
print("Status Code:", response.status_code)
print("Response Body:", response.text)
If you make any changes to the Azure function through portal editing, you may need to restart the function app to reflect the changes.
If you keep seeing the issue despite making the above changes, please share more details on the Python version, function app runtime version, function app name for additional investigation.