curl-rest
A reqwest-like REST client built on libcurl for true blocking requests.
Install
[]
= "0.1"
libcurl dependency
curl-rest is backed by libcurl, so your build will need a libcurl development package available on the system (for example, installed via your OS package manager). If you prefer a vendored build or static linking, enable the appropriate curl/curl-sys features in your application so Cargo propagates them to this crate.
This crate exposes a few convenience features (default is ssl):
ssl: enable OpenSSL-backed TLS (libcurl's default).rustls: enable Rustls-backed TLS (disable default features in your dependency to avoid OpenSSL).static-curl: build and link against a bundled libcurl.static-ssl: build and link against a bundled OpenSSL.vendored: enables bothstatic-curlandstatic-ssl.
Usage
let resp = default
.get
.header
.query_param_kv
.send
.expect;
println!;
println!;
Headers
let resp = default
.get
.header
.header
.send?;
# Ok::
Query params
let resp = default
.get
.query_param_kv
.query_param_kv
.send?;
# Ok::
JSON body
let resp = default
.post
.body_json
.send?;
# Ok::
Examples
TOKEN=secret
Benchmarks
License
MIT