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

Allow users to specify an existing web client #5

Open
qwerty01 opened this issue Nov 27, 2020 · 1 comment
Open

Allow users to specify an existing web client #5

qwerty01 opened this issue Nov 27, 2020 · 1 comment

Comments

@qwerty01
Copy link
Owner

Currently, the crate creates its own webclient when you use one of the backend features. In order to use an existing client, users currently have to implement BeatSaverApi either for the client they're using, or for a wrapper struct. It would be more convenient to provide a trait that adds new(client: Client) for each of the backends.

@qwerty01
Copy link
Owner Author

This will work via a From<Client> implementation. One area that may be useful is setting user agents, but this might not be practical since some clients don't support a client-wide user agent and the user agent change is set at request time.
At the moment, only the Reqwest backend will support custom user agents via the From<Client> implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant