Expand description
§雪風(Yukikaze)
Beautiful and elegant Yukikaze is little HTTP library based on hyper.
§Getting started:
§Features
- Uses rustls for TLS
- Support of various types of bodies: Plain text, JSON, multipart and forms
- Simple redirect policy with option to limit number of redirections.
- Support for text encodings aside from UTF-8.
- Various helpers to extract useful headers: Cookies, ETag/Last-Modified, Content related headers.
- File redirection support for response’s body.
- Notify interface to indicate progress of body’s download.
§Available cargo features
rustls- Enables use ofrustlsfor default SSL implementation. By defaulton.compu- Enables compression support. By defaulton.encoding- Enablesencodingcrate support. Defaultoff.websocket- Enables Websocket Upgrade mechanism. Defaultoff. Enablescarry_extensionswhenon.carry_extensions- Carrieshttp::Extensionsfrom request to resolvedResponse. Defaultoff.
§Examples
§Client
use yukikaze::client::Request;
mod global {
yukikaze::declare_global_client!();
}
use global::{GlobalRequest};
async fn google() {
let res = Request::get("https://google.com").expect("To create get request")
.empty()
.global() //Makes request to go to global client
.send();
let result = yukikaze::matsu!(res).expect("To get without timeout")
.expect("Successful response");
assert!(result.is_success());
}Re-exports§
pub extern crate async_timer;pub extern crate bytes;pub extern crate compu;pub extern crate cookie;pub extern crate data_encoding;pub extern crate encoding_rs;pub extern crate etag;pub extern crate http;pub extern crate http_body;pub extern crate httpdate;pub extern crate hyper;pub extern crate mime;pub extern crate percent_encoding;pub extern crate serde;pub extern crate serde_json;pub extern crate serde_urlencoded;
Modules§
- client
- Client module
- connector
- TLS module
- extractor
- Extractors module
- header
- Headers module
- rt
- Runtime module.
- upgrade
- Upgrade extension for client side
- utils
- Yukikaze-sama utilities.
Macros§
- declare_
global_ client - Declares global client for use.
- matsu
- Await future in async context.