Skip to content

basic http authentication #854

@lcowell

Description

@lcowell

As far as I can tell, hyper does not support basic http authentication in the client. Here is my code (as I likely may have done something wrong):

fn main() {
    let client = Client::new();
    let mut response = client.get("http://user:pass@localhost:3000").send().unwrap();
    let mut s = String::new();
    response.read_to_string(&mut s);
    println!("{}", s);
}

Can someone confirm whether basic auth is supported? Are there any alternatives? Should I hand-roll the header?

If nothing else comes of this request I'm ok. Simply by filing this issue the next guy trying to use basic auth is going see this and save some time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions