Closed jamwaffles closed 4 years ago
~Give this a try~ I stand corrected,the same happens with the http_ytpes::headers
let response = surf::Request::new(method, url)
.set_header(http_types::headers::CONTENT_TYPE, "application/json")
.recv_json().await?;
Thanks for fixing this! Looking forward to the next release :)
I'm getting a panic at runtime when attempting to set a header on a
Request
. I could be misusing the library so please let me know if that's the case.It looks like the error might be coming from http_types::Request::insert_header.
I've tried
cargo clean
/rm Cargo.lock
/cargo build
to no avail.The following code panics at runtime in alpha.3:
The pertinent information from the backtrace appears to be this:
If I comment out the
set_header
line, the request goes through (although therecv_json
breaks now because the server doesn't respond properly).The following code works in alpha.2: