-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to get the http response status_code #2579
Comments
Yes, you can use the If this helps you out, you can close the issue. Thanks so much for reaching out! |
Thank you @iscai-msft for your reply. I can now get the status_code in this way. But it seems difficult to make it safe in async or multi-thread use cases and the ideal way I think is to return it as an attribute of the response object. (just like @azure-tools/typespec-ts does - see below screenshots) |
@alfie80 I understand the difficulty, this was a design choice we made a while back. While other languages would return a response of T, we would just return T, and if you wanted more response information, you would have to access through callback since it wasn't the main scenario. I'm tagging @johanste the architect of the Python SDK for any more input / questions Could you also go more into the use case of accessing the status code? There are options where you can customize the generated code to change this behavior if you expect the users of your SDK to care more about this information |
Currently the generated code will return the deserialized response.json() which contains the response body only. Is there any way to return the status_code to the user as well?
The text was updated successfully, but these errors were encountered: