Skip to content
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

Provide a means for implementors to be able to access the final API request made #39

Open
apotek opened this issue Sep 25, 2024 · 1 comment · Fixed by #40 or #41
Open

Provide a means for implementors to be able to access the final API request made #39

apotek opened this issue Sep 25, 2024 · 1 comment · Fixed by #40 or #41
Assignees

Comments

@apotek
Copy link
Contributor

apotek commented Sep 25, 2024

Description

Code that uses this library can pass parameters to the request and get back response data. However, for diagnostics, a user of this library might need to be able to track the actual request that was made, for debugging, testing, etc.

If the Endpoint class could provide a method to return the actual request made (either as a Request object) or as a simple string consisting of METHOD PATH PARAMS, that would help in being able to track the actual behavior of the API.

Issue Owner

@apotek

Proposed Solution

The Endpoint parent class (and interface) should have a getRequest() method that always contains that most recent request made by the class.

This means that the Endpoint, when making the request, would need to store the Request (or request string) to a class variable (or similar) just before or after making the request.

Alternatives Considered

Additional Context

Tasks

No tasks being tracked yet.
@apotek apotek self-assigned this Sep 25, 2024
@adamzimmermann
Copy link
Contributor

a user of this library might need to be able to track the actual request that was made, for debugging, testing, etc.

I encountered this very thing multiple times, so I'm in full support of this. It was hard to figure out exactly where in the code you could find the literal HTTP request string with all of the additions/alterations/etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment