-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add init option to add raw response to return values #414
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is an improvement but it should be noted that the underlying response isn't always returned. The SDK's underlying |
Explicitly notifying @nmuesch again. |
Hey @mzizzi Thats a valid point! I was taking a look but I don't see a way to keep this backwards compatible, thread safe, and return the raw response always. The HTTP Request wrapper, as it currently stands, wouldn't be able to return the response object and maintain the error codes its returning. I'm going to reopen #408 but I don't think this is something we'll be able to tackle in the short term. |
@nmuesch currently I get this issue : |
Hey @VidhushiniSrinivasan16 ! Looks like your issue is similar to #460 I recently merged a PR (#461) that would add its default value to the module in order to solve that import error, but it is not yet released. Hope this helps ! |
@zippolyte Thanks Henry. That worked for me! |
* Revert "Add new top level `api` function to get the response object of last request (DataDog#412)" * Add support for retrieving raw response
* Revert "Add new top level `api` function to get the response object of last request (DataDog#412)" * Add support for retrieving raw response
Reverts #412 and re implements in a different way.
This PR makes the approach threadsafe while keeping backwards compatibility by using a configuration option passed through the global init.
return_raw_response
is set to false by default, but when its explicitly enabled, we return the decoded response as well as the raw response object from thesubmit
method.