def METHOD_NAME(location: LocationType) -> dict[str, Any]:
    """Return headers for redirect without page-reload response."""
    if spec := {key: value for key, value in location.items() if value}:
        return {HTMXHeaders.LOCATION.value: encode_json(spec).decode()}
    raise ValueError("redirect_to is required parameter.")