Stratal API Reference
    Preparing search index...

    Class TestHttpClient

    TestHttpClient

    Fluent HTTP client for making test requests.

    const response = await module.http
    .forHost('example.com')
    .post('/api/v1/users')
    .withBody({ name: 'Test' })
    .send()

    response.assertCreated()
    Index

    Constructors

    Methods

    post

    • Set the locale for all requests from this client (returns a new client). If strategy is not provided, resolves from the module's I18n configuration.

      Parameters

      • locale: string

        Locale code (e.g., 'en', 'fr')

      • Optionalstrategy: DetectionStrategy

        Detection strategy override

      Returns TestHttpClient