alexcrichton / curl-rust

Rust bindings to libcurl
MIT License
1.02k stars 235 forks source link

Problem with PUT request (Easy2) #329

Closed emreyalvac closed 4 years ago

emreyalvac commented 4 years ago

Hi,

I get this error when i send put request with Easy2 struct. It's working with Easy.

Mark bundle as not supporting multiuse

and

NetworkError(Error { description: "Failure when receiving data from the peer", code: 56, extra: None })'
handler.put(true);
let mut list = List::new();
list.append("Content-Type: application/json");
let mut _data = data.unwrap().as_bytes();
 handler.post_field_size(_data.len() as u64).unwrap();
handler.post_fields_copy(_data).unwrap();
handler.http_headers(list);
handler.verbose(true);
handler.perform().unwrap();
emreyalvac commented 4 years ago

Ok, i've solved with custom_request.

Thanks anyway 🙂