rust-lang-nursery / rust-cookbook

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

querying-the-web-api examples don't work due to missing user-agent-headers #663

Open suren-m opened 2 years ago

suren-m commented 2 years ago

Fixed runtime decoding error occurring due to 403 responses from gh api because of missing user-agent header

fixes #662

Feel free to close if you still prefer to use reqwest::get for the example but with a different api that doesn't require user-agent-header. I'm currently unaware of how to pass headers along with reqwest::get and thus used a reqwest client in the fix

toanju commented 2 years ago

Ran into the same issue. Thanks for writing this up. Worked like a charm. I wish it was already merged ;)

tompscanlan commented 1 year ago

Also hit the same thing and this is better work than I came up with :)