Curl-Rust
libcurl bindings for Rust. This project is in active development and could (will probably) break API compatibility at any time.
Quick Start
extern crate curl;
use http;
Response header names are automatically lower cased.
Post / Put requests
Both of these methods expect that a request body is provided. A request
body can be a &[u8]
, &str
, or &Reader
. For example:
let resp = handle
.post
.exec.unwrap;
Custom headers
Custom headers can be specified as part of the request:
.get
.header
.exec;
handle
Keep alive
The handle can be re-used across multiple requests. Curl will attempt to keep the connections alive.
let handle = handle;
let resp1 = handle.get.exec.unwrap;
let resp2 = handle.get.exec.unwrap;
Version Support
The bindings have been developed using curl version 7.24.0. They should work with any newer version of curl and possibly with older versions, but this has not been tested.