-
Notifications
You must be signed in to change notification settings - Fork 0
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
Capture the request data to the response to enable logging and troubleshooting #40
Capture the request data to the response to enable logging and troubleshooting #40
Conversation
The failing tests are not trivial to fix. Will take some work. |
@@ -128,7 +126,7 @@ public function request( | |||
|
|||
try { | |||
// Make a request with given parameters. | |||
return new Response($this->client->request($method, $url, $options)); | |||
return new Response($this->httpClient, $method, $url, $options); |
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.
@apotek Just checking if ->request()
was accidentally left off. I see the original has it.
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.
@apotek Just checking if
->request()
was accidentally left off. I see the original has it.
You are right to ask about this. This change set changes the constructor of the Response class to no longer accept a GuzzleResponse (which is what client->request() would return), but instead accepts the request client object, and the request parameters:
This allows the constructor function in the Response object to save some data to itself about the request that is about to be made, so that the Response can be queried for data about the request that created that response.
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.
👍 I asked a question to double-check something that caught my eye, but otherwise looks mean and clean.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Description
In this merge request we add the API request data to our custom response object so that any caller who receives a response will be able to see the exact request data that produced the response. This can be helpful for diagnostics and troubleshooting,.
Motivation / Context
Greater insight into what the API is doing.
Resolves #39
Testing Instructions / How This Has Been Tested
Documentation