Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple HTTP client library written for educational purposes.

Example 1: Simple File Download

use http_client::{client::Client, error::HttpError};
fn main() -> Result<(), HttpError> {
    let mut file = std::fs::File::create("video.mp4")?;
    let client = Client::new();
    client
        .get("localhost:8080/Video.mp4")?
        .download_to_file(&mut file)?;

    Ok(())
}

Example 2: Form Submission:

use http_client::{client::Client, error::HttpError};
fn main() -> Result<(), HttpError> {
    let client = Client::new();
    client
        .post("localhost:8080/login_action")?
        .form_data("email", "test@mail.com")
        .form_data("password", "password")
        .send()?;
    Ok(())
}

About

A Basic HTTP Client library written for educational purposes.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages