denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
94.53k stars 5.25k forks source link

Use `reqwest_middleware` lib to allow adding HTTP middleware. #23516

Open maxmcd opened 5 months ago

maxmcd commented 5 months ago

Hi, I was curious if there was interest to replace the reqwest::Client use in the codebase with reqwest_client::ClientWithMiddleware too allow for adding things like tracing and other middleware analysis to Deno network requests. This is not from the position of an end user using Deno, I am using Deno as a Rust library. I'm looking to get better visibility into network requests and debugging of import requests.

I am already doing this work, but wanted to see if it could be upstreamed. So far it doesn't seem too invasive.

Thanks!

bartlomieju commented 5 months ago

Feel free to open a PR, though I must warn you that we've had internal discussions about moving away from reqwest. Not sure about the timeline though :)

maxmcd commented 5 months ago

Thanks @bartlomieju, sounds good. Happy to work with whatever the successor is if reqwest is replaced.

I've opened a PR here: https://github.com/denoland/deno/pull/23539