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

Create an API around a "Client" struct #10

Open
panicbit opened this issue Jun 26, 2021 · 0 comments
Open

Create an API around a "Client" struct #10

panicbit opened this issue Jun 26, 2021 · 0 comments

Comments

@panicbit
Copy link
Owner

panicbit commented Jun 26, 2021

An API that requires to instance and keep around a Client has a few advantages:

  • More efficient
    • Url only needs to be parsed once
    • reqwest client can be reused (this is a significant performance boost)
  • Better testability by allowing to point the client to a test / mock server (Mock recaptcha API in tests #6)

The current verify API can be kept for backwards compatability and also for getting a good quickstart with the crate (similar to how there is reqwest::get).

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

No branches or pull requests

1 participant