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

Consolidate HTTP client libraries to reduce complexity #1629

Closed
overcat opened this issue Sep 26, 2024 · 6 comments · Fixed by #1632
Closed

Consolidate HTTP client libraries to reduce complexity #1629

overcat opened this issue Sep 26, 2024 · 6 comments · Fixed by #1632
Assignees

Comments

@overcat
Copy link
Contributor

overcat commented Sep 26, 2024

What problem does your feature solve?

Currently, the project is using multiple HTTP client libraries:

This diversity of HTTP clients may lead to several issues:

  • Increased complexity in the codebase
  • Potential inconsistencies in how HTTP requests are handled
  • Difficulties in maintaining and updating dependencies

What would you like to see?

We should consider consolidating our HTTP client usage to a single library. This would simplify the codebase, reduce potential inconsistencies, and make maintenance easier.

What alternatives are there?

N/A

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Sep 26, 2024
@leighmcculloch
Copy link
Member

Where are the different libraries being used?

@overcat
Copy link
Contributor Author

overcat commented Sep 26, 2024

Where are the different libraries being used?

The following is the code in the project

ureq:


hyper:
let response = hyper::Client::builder()

reqwest (stellar-ledger):
use reqwest::{Client as HttpClient, Response};

@leighmcculloch
Copy link
Member

Thanks.

hyper is also in use in the stellar/rs-stellar-rpc-client repo (the jsonrpsee http client lib uses hyper) which the cli imports.

reqwest also uses hyper.

@leighmcculloch
Copy link
Member

If we were to make a change here, I'd suggest replacing ureq and reqwest with hyper.

@overcat
Copy link
Contributor Author

overcat commented Sep 26, 2024

If we were to make a change here, I'd suggest replacing ureq and reqwest with hyper.

I saw it written on https://github.com/hyperium/hyper:

If you are looking for a convenient HTTP client, then you may wish to consider reqwest.

If there are no special reasons, using reqwest seems like a good choice. Although it relies on hyper, we won't be using hyper directly in the code.

@leighmcculloch
Copy link
Member

That sounds fine too. In which case we could update the ureq case and leave everything else.

@janewang janewang moved this from Backlog (Not Ready) to In Progress in DevX Sep 30, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in DevX Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants