tokio-rs / axum

Ergonomic and modular web framework built with Tokio, Tower, and Hyper
18.35k stars 1.03k forks source link

Fixes: #2767 Update reqwest-response example #2852

Closed redforks closed 1 month ago

redforks commented 1 month ago

Motivation

Update reqwest-response example, as explained by https://github.com/tokio-rs/axum/issues/2767#issuecomment-2150559926

Solution

Based on https://github.com/tokio-rs/axum/issues/2767#issuecomment-2150559926

redforks commented 1 month ago

Reconstruct code:

  1. revert the change that use SyncStream
  2. Remove two unnecessary type conversion: status and headers
  3. Method name renamed