Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
terminal out
RUST_BACKTRACE=1 cargo run --example gzip
Compiling reqwest v0.1.0 (file:///Users/jasonschein/Code/rust/reqwest)
warning: variable does not need to be mutable, #[warn(unused_mut)] on by default
--> examples/gzip.rs:12:9
|
12 | let mut client = reqwest::Client::new().unwrap();
| ^^^^^^^^^^
warning: variable does not need to be mutable, #[warn(unused_mut)] on by default
--> examples/gzip.rs:14:9
|
14 | let mut builder = client.get("https://www.google.com")
| ^^^^^^^^^^^
Finished debug [unoptimized + debuginfo] target(s) in 3.79 secs
Running `target/debug/examples/gzip`
GET https://www.rust-lang.org
RequestBuilder { client: Client { inner: Client { redirect_policy: FollowNone, read_timeout: None, write_timeout: None, proxy: None } }, method: Get, url: Ok("https://www.google.com/"), _version: Http11, headers: Headers { Accept-Encoding: gzip, }, body: None }
Status: Ok
Headers:
Headers { Set-Cookie: NID=91=mDmQGrW7REJMhkoVwPJW3u3wNomvf8CKiGOiOcMVNm0hS5VvTahU3vJQ8K8Zm0D4YoiizGxGXAT6xNDb9U8mq5OypphGhG2KZitYwF5WIyRBr6OV4SSdq8GPp2Uvtg-lv6mYAUXUxZAIJfw; expires=Thu, 25-May-2017 05:08:52 GMT; path=/; domain=.google.com; HttpOnly, P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info.", Date: Wed, 23 Nov 2016 05:08:52 GMT, X-XSS-Protection: 1; mode=block, Cache-Control: private, max-age=0, Expires: -1, Transfer-Encoding: chunked, Alt-Svc: quic=":443"; ma=2592000; v="36,35,34", Content-Encoding: gzip, Server: gws, Content-Type: text/html; charset=ISO-8859-1, X-Frame-Options: SAMEORIGIN, }
Body:
---
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Custom(Custom { kind: InvalidInput, error: StringError("invalid gzip header") }) }', ../src/libcore/result.rs:799
stack backtrace:
1: 0x102ecf3b8 - std::sys::backtrace::tracing::imp::write::h6f1d53a70916b90d
2: 0x102ed17cf - std::panicking::default_hook::{{closure}}::h137e876f7d3b5850
3: 0x102ed07d5 - std::panicking::default_hook::h0ac3811ec7cee78c
4: 0x102ed0de6 - std::panicking::rust_panic_with_hook::hc303199e04562edf
5: 0x102ed0c84 - std::panicking::begin_panic::h6ed03353807cf54d
6: 0x102ed0ba2 - std::panicking::begin_panic_fmt::hc321cece241bb2f5
7: 0x102ed0b07 - rust_begin_unwind
8: 0x102ef6f60 - core::panicking::panic_fmt::h27224b181f9f037f
9: 0x102cb32ec - core::result::unwrap_failed::hbbe45964de00535c
10: 0x102caec81 - <core::result::Result<T, E>>::unwrap::h64cd6f2c8b4c5081
11: 0x102cc2db5 - gzip::main::hd9938c9da12b0b85
12: 0x102ed1d8a - __rust_maybe_catch_panic
13: 0x102ed0316 - std::rt::lang_start::h538f8960e7644c80
14: 0x102cc3159 - main
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." name="description"><meta content="noodp" name="robots"><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title><script>(function(){window.google={kEI:'ZCQ1WOi8B8rojwOQ8LHIBQ',kEXPI:'1351903,3700278,4028875,4029815,4031109,4032677,4036527,4038012,4039268,4043492,4045841,4048347,4052304,4062666,4062983,4064904,4065786,4066196,4067860,4068550,4069838,4069841,4071842,4072364,4072602,4072775,4073111,4073405,4073757,4073959,4076096,4076315,4076931,4076998,4078430,4078438,4078457,4079082,4079105,4079442,4079625,4079894,4080167,4080629,4081037,4081039,4081265,4081913,4082217,4082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment