Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always fail with reqwest blocking #144

Closed
kinosang opened this issue Nov 18, 2021 · 1 comment
Closed

Always fail with reqwest blocking #144

kinosang opened this issue Nov 18, 2021 · 1 comment

Comments

@kinosang
Copy link

use core::time::Duration;
use reqwest::header::USER_AGENT;

let _m = mock("GET", "/hello")
    .with_status(200)
    .with_header("content-type", "text/plain")
    .with_body("Hello World")
    .create();

let host = mockito::server_url();

let timeout = Duration::from_millis(3_000);

let client = reqwest::blocking::Client::new();

let req = client
    .get(format!("{}/hello", host))
    .header(USER_AGENT, "ParamiLinker/1.0")
    .timeout(timeout);

let res = req.send().unwrap();

assert_eq!(res.bytes().unwrap().to_vec(), b"Hello World".to_vec());

fail to assert or got 503 error

left: `[]`,
right: `[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]`
@lipanski lipanski mentioned this issue Feb 5, 2023
7 tasks
@lipanski
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants