Following-up, just to clarify, are receiving an error response or is it just the quality of the result isn't as good?
A good reference is the Python code that generates the HTTP request for the webapp: https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/app.py#L162 - You may compare that with your code to understand any discrepancy.