zjhttpc 0.9.0

HTTP client made by Jinhui ZHANG. Aims at easy to use, with special features I want
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// use anyhow_ext::Result;
use thiserror::Error;

// type ZjhttpCResult<T> = Result<T, ZjhttpcError>;

#[derive(Debug, Error)]
pub enum ZjhttpcError {
    #[error("failed to parse the URL: {0}")]
    InvalidUrl(#[from] url::ParseError),
    #[error("no host in url")]
    NoHost,
    #[error("invalid/unsupport HTTP version in response:{0}")]
    InvalidHttpResponseVersion(String),
    #[error("invalid HTTP status code in response:{0}")]
    InvalidHttpResponseStatusCode(String),
    #[error("the response body has been read")]
    BodyHasBeenRead,
}