---
title: Custom Responses
description: Explains how to define custom, request-aware responses in your mocks.
---
import { Aside } from '@astrojs/starlight/components';

This section explains how to configure the mock server to generate **dynamic responses**.  
Custom responses give you full control over the returned status, headers, and body at runtime.

<Aside type="caution" title="Attention">
    Custom responses are **not available** when connecting to standalone mock servers (e.g., by using one of the
    `connect` methods, such as
    [`MockServer::connect`](https://docs.rs/httpmock/0.7.0/httpmock/struct.MockServer.html#method.connect)).
</Aside>

## `respond_with`

{{{docs.then.respond_with}}}
