rust-lang-nursery / rust-cookbook

https://rust-lang-nursery.github.io/rust-cookbook
Creative Commons Zero v1.0 Universal
2.29k stars 288 forks source link

Rewrite header recipes for hyper 0.12 #419

Open AndyGauge opened 6 years ago

AndyGauge commented 6 years ago

Apparently, changes have been made to hyper 0.12 that breaks the header! implementation. Those changes should be reviewed and implemented into the recipes. Documentation is being moved to doc.servo.org until the recipes have been revamped.

Check out the changelog

budziq commented 6 years ago

Currently two examples using custom headers are broken:

As there are several ways to approach the implementation I'd like to pick @seanmonstar 's brain for suggestion on what would be the most idiomatic approach for custom header definition for our readers to learn from.

cc https://github.com/seanmonstar/reqwest/issues/312

seanmonstar commented 6 years ago

Typed headers are being working on as a new crate: https://github.com/hyperium/headers

In the mean time, I might suggest removing the recipes completely. I'd expect the new crate to show how to create a new header type in its documentation.

budziq commented 6 years ago

Thanks a lot for the info @seanmonstar! I guess that we will hide the examples (https://github.com/rust-lang-nursery/rust-cookbook/pull/430) and revert them once the custom header story is sorted out on hyper side. What are your thoughts @AndyGauge ?

AndyGauge commented 6 years ago

Sounds like a plan of action. We can leave this open as a reminder once headers lands.