Skip to content

Example Query the GitHub API needs user_agent to work #650

Open
@bodemann

Description

The first example in https://rust-lang-nursery.github.io/rust-cookbook/web/clients/apis.html is not working anymore. Apperently github needs a user agent now.

I (as a beginner) changed the code to:

let client  = reqwest::Client::builder()
        .user_agent("Rust_Reqwest_Test")
        .build()?;
    // let response = reqwest::get(&request_url).await?;
    let response = client.get(&request_url)
        .send()
        .await?;

Credit to Globi::<!> from the Rust Discord who helped me identify the problem.

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