Add init option to add raw response to return values#414
Conversation
|
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_responseis set to false by default, but when its explicitly enabled, we return the decoded response as well as the raw response object from thesubmitmethod.