actix-web/actix-test
Bruno Oliveira 2b090e0817 feat: add QUERY method helpers to awc client and test servers
Extend HTTP QUERY (RFC 10008) support to the remaining per-method
convenience surfaces, mirroring PATCH:

- awc: `Client::query()`
- actix-test: `TestServer::query()`
- actix-http-test: `TestServer::query()` and the HTTPS `TestServer::squery()`

Also tighten `TestRequest::query()`'s doc to match its sibling helpers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 19:21:22 -03:00
..
src feat: add QUERY method helpers to awc client and test servers 2026-07-07 19:21:22 -03:00
CHANGES.md feat: add QUERY method helpers to awc client and test servers 2026-07-07 19:21:22 -03:00
Cargo.toml chore: narrow tokio dep to account for RUSTSEC-2025-0023 2025-05-10 06:09:51 +01:00
LICENSE-APACHE migrate integration testing to new crate (#2112) 2021-04-02 08:26:59 +01:00
LICENSE-MIT migrate integration testing to new crate (#2112) 2021-04-02 08:26:59 +01:00
README.md build(deps): bump time from 0.3.45 to 0.3.46 (#3893) 2026-01-28 08:10:27 +00:00

README.md

actix-test

crates.io Documentation Version MIT or Apache 2.0 licensed
dependency status Download Chat on Discord

Integration testing tools for Actix Web applications.

The main integration testing tool is [TestServer]. It spawns a real HTTP server on an unused port and provides methods that use a real HTTP client. Therefore, it is much closer to real-world cases than using init_service, which skips HTTP encoding and decoding.

Examples

use actix_web::{get, web, test, App, HttpResponse, Error, Responder};

#[get("/")]
async fn my_handler() -> Result<impl Responder, Error> {
    Ok(HttpResponse::Ok())
}

#[actix_rt::test]
async fn test_example() {
    let srv = actix_test::start(||
        App::new().service(my_handler)
    );

    let req = srv.get("/");
    let res = req.send().await.unwrap();

    assert!(res.status().is_success());
}